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.
18 lines
558 B
TypeScript
18 lines
558 B
TypeScript
/**
|
|
* textLimits — font-size constraints for plain text items.
|
|
*
|
|
* Used by creation defaults to keep initial sizes reasonable.
|
|
* Direct manipulation (resize-bake) intentionally bypasses these
|
|
* clamps so users can scale text to any size.
|
|
*
|
|
* Sticky notes use discrete presets (S/M/L/XL/XXL) defined in
|
|
* TextFormatToolbar.tsx — not continuous clamps.
|
|
*/
|
|
|
|
const TEXT_FONT_MIN = 6;
|
|
const TEXT_FONT_MAX = 160;
|
|
|
|
export function clampTextFontSize(size: number): number {
|
|
return Math.round(Math.min(TEXT_FONT_MAX, Math.max(TEXT_FONT_MIN, size)));
|
|
}
|