feat: RefBoard v0.5.0 — PureRef-style shortcuts, clipboard fix, zoom normalization

- Add 40+ keyboard shortcuts via declarative registry system (shortcut-definitions.ts)
- Fix canvas tainting: patch crossOrigin before loadFromJSON in all paths (init, sync, undo/redo)
- Fix clipboard copy-to-system with proper async blob handling and error toasts
- Fix zoom wheel: normalize deltaY across mice/trackpads with consistent 8% step
- Add operations module: alignment, distribution, normalization, arrangement, flip, grayscale, lock, overlay compare
- Add breakSelection() to fix ActiveSelection relative coordinate bugs
- Add shortcuts help overlay (? / F1) auto-generated from registry
- Add grid overlay toggle (G key)
- Fix 10 shortcut bugs: Ctrl+Y/P conflicts, ? key matching, arrow conflicts, Ctrl+S intercept, context menu stale objects
This commit is contained in:
Hiren
2026-03-09 18:29:35 +05:30
parent 9e5c4ecdd0
commit cdeafce7ad
10 changed files with 1389 additions and 338 deletions
+13 -1
View File
@@ -57,7 +57,7 @@ export function setupSync(
if (_suppress) return;
// Ensure all objects have IDs before serializing
canvas.getObjects().forEach(ensureId);
const scene = (canvas as any).toJSON(['id']);
const scene = (canvas as any).toJSON(['id', 'crossOrigin']);
socket.emit('scene:update', { boardId, scene });
}, SCENE_THROTTLE);
}
@@ -89,6 +89,18 @@ export function setupSync(
function doApplyScene(scene: any) {
_suppress = true;
// Ensure all images have crossOrigin set before Fabric loads them,
// otherwise the canvas becomes tainted and clipboard copy breaks.
if (scene?.objects) {
for (const obj of scene.objects) {
if (obj.type === 'image') obj.crossOrigin = 'anonymous';
if (obj.type === 'group' && obj.objects) {
for (const child of obj.objects) {
if (child.type === 'image') child.crossOrigin = 'anonymous';
}
}
}
}
canvas.loadFromJSON(scene)
.then(() => {
canvas.requestRenderAll();