refactor(sticky): fixed-width card with S/M/L/XL/XXL font presets
Stickies are now fixed-width cards — no resize handles shown. Text size controlled via 5 presets (10/14/18/24/32px). On creation, zoom-aware screenToWorld snaps to nearest preset. Height auto-adjusts from content. Plain text resize unchanged. Removes: sticky width bake, live reflow drag, min width constraint. Backward compatible — existing stickies map to nearest preset.
This commit is contained in:
@@ -14,7 +14,6 @@ import { AnnotationStore } from '../stores/annotationStore';
|
||||
import { PinOverlay } from '../canvas/PinOverlay';
|
||||
import { CropOverlay } from '../canvas/CropOverlay';
|
||||
import { TextSprite } from '../canvas/sprites/TextSprite';
|
||||
import { StickySprite } from '../canvas/sprites/StickySprite';
|
||||
import { TextSharpnessManager } from '../canvas/textSharpness';
|
||||
// PresenceOverlay removed — remote selection highlighting was too heavy for minimal benefit
|
||||
import { connectSocket, disconnectSocket } from '../socket';
|
||||
@@ -229,18 +228,6 @@ export function useCanvasSetup(deps: CanvasSetupDeps) {
|
||||
d.h = item.displayObject.measuredHeight;
|
||||
}
|
||||
item.displayObject.scale.set(d.sx, d.sy);
|
||||
} else if (item.type === 'sticky') {
|
||||
const d = item.data as any;
|
||||
// Bake width only — text re-wraps and height auto-adjusts.
|
||||
// fontSize stays stable so the card acts like a resizable text box.
|
||||
d.w = Math.max(80, Math.round(d.w * absSx));
|
||||
d.sx = item.data.sx > 0 ? 1 : -1;
|
||||
d.sy = item.data.sy > 0 ? 1 : -1;
|
||||
if (item.displayObject instanceof StickySprite) {
|
||||
item.displayObject.updateFromData(d);
|
||||
d.h = item.displayObject.computedHeight;
|
||||
}
|
||||
item.displayObject.scale.set(d.sx, d.sy);
|
||||
}
|
||||
}
|
||||
onCanvasChange(itemIds);
|
||||
|
||||
Reference in New Issue
Block a user