From 94c463590707071bb9576b0f8e3edbe94a3dc8b5 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Fri, 27 Feb 2026 22:15:35 +0300 Subject: [PATCH] Add rotation, multi-select bbox, snap guides, text tool, color picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rotation: - Rotation handle above selection (line + circle) - Drag to rotate, Shift snaps to 15° increments - Live preview during drag, applied on release - Rotated nodes render correctly with canvas.rotate() Multi-select bounding box: - Individual outlines per node + unified group bbox - Group resize handles on the unified bounds - Handles rotated AABB for rotated nodes Snap guides: - Magenta guide lines when moving nodes near edges/centers - Snaps to left/right/top/bottom/center of other nodes - 5px threshold, guides clear on mouse up Text tool: - T shortcut or toolbar to activate - Click to place text node (200×24, default 'Text') - CanvasKit drawText with default font (Inter to come) Color picker (Reka UI Popover): - HSV saturation/brightness area with pointer drag - Hue slider (rainbow gradient) - Alpha slider - Hex input + alpha percentage - Live color updates to fill/stroke Properties panel: - Add/remove fills and strokes with +/× buttons - Toggle fill visibility - Stroke weight editing - Multi-select shows layer count + shared opacity - ColorPicker integrated for fill and stroke colors Frame clipping: - Frame children now clip to parent bounds --- src/components/ColorPicker.vue | 371 +++++++++++++++++++++++++++ src/components/PropertiesPanel.vue | 256 ++++++++++++++++--- src/composables/use-canvas-input.ts | 187 +++++++++++--- src/composables/use-canvas.ts | 6 +- src/engine/renderer.ts | 372 ++++++++++++++++++++++------ src/engine/scene-graph.ts | 16 ++ src/engine/snap.ts | 132 ++++++++++ src/stores/editor.ts | 18 +- 8 files changed, 1204 insertions(+), 154 deletions(-) create mode 100644 src/components/ColorPicker.vue create mode 100644 src/engine/snap.ts diff --git a/src/components/ColorPicker.vue b/src/components/ColorPicker.vue new file mode 100644 index 000000000..8b44f4fbd --- /dev/null +++ b/src/components/ColorPicker.vue @@ -0,0 +1,371 @@ + + + + + diff --git a/src/components/PropertiesPanel.vue b/src/components/PropertiesPanel.vue index 83e3ffc7b..9ecb0bb9d 100644 --- a/src/components/PropertiesPanel.vue +++ b/src/components/PropertiesPanel.vue @@ -1,41 +1,135 @@