From 64305861e0fa14e6ab7d727f83711ff0a123be8d Mon Sep 17 00:00:00 2001 From: MelekTaus Date: Mon, 21 Sep 2026 06:26:07 +0200 Subject: [PATCH] Snap is a magnet button in the docs (#194) The pages described snapping as a checkbox and, in vector art, as a Grid button. Both are now the same magnet toggle. - Behaviors, State machines, Particles, Shaders and Vector Art name the magnet instead of the checkbox or the Grid button. - Architecture lists SnapToggle and headerIcons. - Development carries the check total 1188. Tests: - 1188 is computed (1184 + 4), the full run is left to CI Co-Authored-By: Claude Opus 5 --- Architecture.md | 6 ++++-- Behaviors.md | 4 ++-- Development.md | 2 +- Particles.md | 2 +- Shaders.md | 2 +- State-machines.md | 2 +- Vector-Art.md | 5 +++-- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Architecture.md b/Architecture.md index 6226d56..2cc92dc 100644 --- a/Architecture.md +++ b/Architecture.md @@ -153,15 +153,17 @@ src/editor/panels/ AssetPanel, assetGroups (groups by type and their order, plus the List, Game and Plugins tabs' own three, which stand for no asset), assetMenu (the two groups of the + menu), HierarchyPanel, Toolbar + toolbarIcons (five icon buttons, no captions: menu, undo, redo, play, pause, #183), + headerIcons (the pictures of the tab headers' switches: the magnet, #194), TilemapPanel (tools, tiles and layers of the one selected tilemap, beside the scene view, #142; painting itself is SceneViewport) src/editor/graph/ GraphEditor (header, breadcrumb), GraphCanvas, graphView (zoom limits, grid, panAndZoom — shared with NodeBoard and the Tile tab's TileCanvas), EdgeLayer (curves and fold marks), graphMenus, NodeView, NodePalette + paletteEntries (which also ranks a search), folding (hidden links, collapsed nodes), Breadcrumb + trail (the path into nested behaviors), beads (the run's pulses), - AnnotationView + annotationDrag (groups and comments: what a drag carries, each thing moved once) + AnnotationView + annotationDrag (groups and comments: what a drag carries, each thing moved once), + SnapToggle (the magnet every tab that snaps carries, the vector art tab included, #194) src/editor/container/ ContainerEditor (header), ContainerCanvas (a SceneViewport on a template) src/editor/texture/ TextureEditor (header), TextureCanvas (picture + frames), SliceDialog (a FormDialog), sheetView (the grid maths), ImagePicker + imageGrid (the "+ → Texture" dialog), checker (the transparency board) -src/editor/vectorart/ VectorArtEditor (header: the two tools and the grid switch), VectorArtCanvas (the drawing +src/editor/vectorart/ VectorArtEditor (header: the two tools and the magnet), VectorArtCanvas (the drawing painted from core/model/vectorPath onto its own Graphics, with points and handles over it; the pen puts points down, the arrow drags points, handles and whole shapes, #129), ShapeList (the shapes as rows with a preview each, in the inspector; a row may be dragged to diff --git a/Behaviors.md b/Behaviors.md index ba87353..9a152b7 100644 --- a/Behaviors.md +++ b/Behaviors.md @@ -293,7 +293,7 @@ shown on the node and editable in the inspector. - **A group is grabbed by its title bar only.** Its body stays transparent to the pointer, or a rubber band could never be drawn across the nodes it holds. The corner at the bottom right resizes it, and resizing moves nothing: what the box ends up around is what it carries next - time. With **Snap** on, the corner being dragged lands on the grid — the far one, since the near + time. With the magnet on, the corner being dragged lands on the grid — the far one, since the near corner is exactly what a resize must leave alone. A comment, framing nothing, is grabbed anywhere on it. - **Deleting one takes the box and nothing else.** The nodes stay exactly where they were — a box @@ -310,7 +310,7 @@ shown on the node and editable in the inspector. the box drawn around them, and a graph holding nothing but a comment would frame the empty origin; `editor/framing.ts`), and the size of the graph as "N nodes · M links". It stops zooming out at 0.25, so a box parked far enough away can still lie outside what a fit can show. -- **Snap** (header checkbox, off by default): a drag drops each node it carries on the nearest +- **Snap** (the magnet in the header, an icon toggle that stays lit while on; off by default): a drag drops each node it carries on the nearest 24 px grid line — the same grid the background draws. It takes effect on the next drag only, so switching it on never shuffles a graph that is already laid out, and a node nobody drags never moves. Every node of a selection snaps **for itself**, so dragging a group is how you line one diff --git a/Development.md b/Development.md index 169fdf8..ae2224e 100644 --- a/Development.md +++ b/Development.md @@ -13,7 +13,7 @@ npm run check # typecheck + lint + format:check + tests, the gate CI runs npm run build # writes dist/ and regenerates index.html ./build.sh # the same under `set -o pipefail`, for callers that pipe the output php tools/make-user.php # an account; every tool signs in (see Accounts) -node tools/seed-e2e.mjs && node tools/e2e.mjs # 1184 editor checks, screenshots in /tmp/gm-e2e-*.png +node tools/seed-e2e.mjs && node tools/e2e.mjs # 1188 editor checks, screenshots in /tmp/gm-e2e-*.png GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step ./e2e.sh start [GM_STEPS] # the same run detached, see below ./e2e.sh status # live progress, or the last run's result diff --git a/Particles.md b/Particles.md index 26b04d5..1f10e68 100644 --- a/Particles.md +++ b/Particles.md @@ -19,7 +19,7 @@ the model was chosen: `+` in the **Assets** panel makes a particle asset and opens the **Particles** tab on it (a double-click on an existing one does the same; a click only selects). The left part is the same canvas the Behavior and Shader tabs have: right-click places a node, drag moves, drag from a port -links, `Snap` snaps to the 24 px grid, `Fit` frames the graph, undo takes every step back. The +links, the magnet snaps to the 24 px grid, `Fit` frames the graph, undo takes every step back. The readout on the right says `N parameters` while the graph compiles, otherwise why it does not (`No Output node`, a bad parameter name, `Feeds itself`). A node that keeps the graph from compiling shows the reason on its body and a red frame; a source whose graph does not compile emits diff --git a/Shaders.md b/Shaders.md index ccd8234..48114db 100644 --- a/Shaders.md +++ b/Shaders.md @@ -9,7 +9,7 @@ shaders; the node set is sized for the recipes below: "Adjust colors", and the c `+` in the **Assets** panel makes a shader and opens the **Shader** tab on it (a double-click on an existing one does the same; a click only selects). The tab has the same canvas the Behavior tab has: right-click places a node, drag moves, drag from a port links, -`Snap` snaps to the 24 px grid, `Fit` frames the graph, undo takes every step back. The readout on +the magnet snaps to the 24 px grid, `Fit` frames the graph, undo takes every step back. The readout on the right says `N properties` while the graph compiles, otherwise why it does not (`No Output node`, a bad property name, ...). A node that keeps the graph from compiling shows the reason on its body and a red frame. diff --git a/State-machines.md b/State-machines.md index 2fb86a5..dbf1ed4 100644 --- a/State-machines.md +++ b/State-machines.md @@ -1,7 +1,7 @@ A **state machine asset** is a named set of states and the moves allowed between them: its graph holds one `State` node per state (a title and a *Name* setting) and one edge per transition. The states are edited in the **State machine** tab, which is the graph -canvas the Behavior tab uses — so placing, dragging, the header's **Snap** checkbox, renaming in +canvas the Behavior tab uses — so placing, dragging, the header's magnet (**Snap**), renaming in the inspector, connecting, `Delete` and undo are the graph's. Double-clicking the asset (or creating it) opens the tab, like every asset with a tab; a click only selects. Right-click on its canvas offers a `State` and diff --git a/Vector-Art.md b/Vector-Art.md index ee0975c..8047265 100644 --- a/Vector-Art.md +++ b/Vector-Art.md @@ -44,7 +44,7 @@ swing the other, which is what lets a curve break at a point. ## The tab -The toolbar holds **Select**, **Pen**, **Grid** and **Fit**; the view pans and zooms like the +The toolbar holds **Select**, **Pen**, the magnet and **Fit**; the view pans and zooms like the Texture tab, and the checkerboard behind the canvas is what is transparent. **Pen** draws a new shape: @@ -63,7 +63,8 @@ Texture tab, and the checkerboard behind the canvas is what is transparent. - **Alt** on a point makes it round, and a round one square again. - **Delete** removes the selected shape. -**Grid** snaps to 8 units while it is on; it is off by default. **Fit** brings the whole canvas back +The **magnet** snaps to 8 units while it is lit; it is off by default. It is the same switch the +graph tabs carry. **Fit** brings the whole canvas back into view. One gesture is **one undo step** — dragging a point across the canvas is a single entry in the undo