fix(sticky): fixed-size creation, shared presets module, live resize sync

Fixes three review findings:

1. Sticky creation no longer zoom-adapts — always creates at M preset
   (28px/260w) in world space. Consistent at any zoom level.

2. Preset definitions extracted to stickyPresets.ts (shared domain module).
   TextFormatToolbar and tools.ts both import from there — no more
   canvas→component dependency inversion.

3. TextEditor.onLiveResize callback syncs spatial index and transform
   box as sticky background grows during typing.
This commit is contained in:
Hiren Kangad
2026-03-13 00:31:44 +05:30
parent 706b00cf35
commit 2d05226ddd
6 changed files with 59 additions and 47 deletions
+3
View File
@@ -130,6 +130,9 @@ export function useCanvasSetup(deps: CanvasSetupDeps) {
}
syncRef.current?.broadcastElements([item.id]);
onCanvasChange();
}, (resizedItem) => {
scene.updateSpatialEntry(resizedItem);
selection.transformBox.update([resizedItem]);
});
};