Snap canvas boxes to each other's edges and centres, with guides
Test and deploy / test (push) Successful in 1m31s
Test and deploy / deploy (push) Successful in 39s

Dragging a box snaps its edges and centre to other boxes' and to the
canvas's sides, centre and top within 6 screen px, and draws a guide
along each shared line; a resize snaps the dragged edge. The 5px grid
still applies elsewhere. An "Align" button in the edit bar turns it off
(kept per browser), and Ctrl/Cmd mid-drag skips it once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-23 22:53:27 +01:00
co-authored by Claude Opus 5.5
parent 7969859955
commit e764078aaf
6 changed files with 220 additions and 33 deletions
+7 -1
View File
@@ -302,7 +302,13 @@ renders any page's boxes.
`/fonts/` without CORS headers.
- **Editing.** Admins get an "Edit layout" toggle at desktop width. Geometry
saves on pointer release, and the box is moved locally first and put back if
the save fails. `BoxEditor.vue` is the side panel. Settings save on change;
the save fails. Dragging snaps a box's edges and centre to other boxes'
edges and centres and to the canvas's sides, centre and top, within 6 screen
px, and draws a pink guide along each line it then shares; a resize snaps
the dragged edge the same way. Elsewhere the 5px grid applies. The pure
geometry is `alignment.js`; the admin bar's "Align" button turns it off (kept
per browser by `editorPrefs.js`), and holding Ctrl/⌘ mid-drag skips it.
`BoxEditor.vue` is the side panel. Settings save on change;
HTML is a draft that previews live and saves with Save or Ctrl/Cmd+S, or
automatically on leaving the box (selecting another, clicking empty canvas,
Done, ✕).