Describe the size gizmo in the scene view (#223)

Scene-editing explains edges, corners and the turn/scale knob. Development has the new check total 1363.
admin committed 2026-09-23 22:37:24 +02:00
1 parent cc8f0b8ced
commit d2dbf02ba6
2 files changed
+18 -1

No files matched your search

+1 -1
@@ -14,7 +14,7 @@ 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 <name> <password> [admin|user] # an account; every tool signs in (see Accounts)
php tests/php/accounts.test.php # the API's account rules, no server needed (CI's gate job)
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1357 editor checks, screenshots in /tmp/gm-e2e-*.png
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1363 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
+17
@@ -59,6 +59,23 @@ the corners; dragging an object moves it in its parent's frame, so a child under
by a quarter walks down the screen when dragged along its own x. `Move` and `Set position` work
in the object's own axes as well.
**Size gizmo.** A selected sprite or collider gets handles on its outline (#223), turned with it:
- **Edges and corners** set Width and Height (a corner both). The opposite side stays where it was,
so the object's position moves by half the change. Sizes land on whole units, at least 1.
A handle reaches 7 pixels outwards but only half that into the object, so a small sprite can
still be grabbed and moved close to its edge.
- A **circle collider** has edge handles only: any edge sets the radius, and the circle stays round.
A polygon or frame collider has no size handles, its corners are edited on the outline itself.
- The **knob** on a stem above the top edge turns *or* scales the object. The first few pixels of
the drag decide which: pulled away from or towards the centre it scales, pulled sideways it
turns. That choice holds until the release, so one drag never does both. Shift snaps a turn to
15°. The turn is the angle swept round the object's centre, so it can go on past a half circle.
- The values go into **this object's overrides**, like "Fit to sprite": a value equal to the
asset's own clears the override. One drag is one undo step.
The rules are in `src/editor/sizeGizmo.ts`, the handles in
`src/editor/viewport/sizeGizmoEditor.ts`.
**Hierarchy (parenting).** Every scene object may have a parent in the same scene
(`SceneObject.parentId`). Positions — including `z` — are **local to the parent**; the world
position is the parent's transform applied to the local one, all the way up (`z` simply adds).