docs(docs): editor overlay handle layer, handle sizes and gesture marks

Step 1 of U2 Task 4: the handle layer as its own focusable svg, R-9 sizes,
the chosen vertex, the old place, the refused place and the move-mode target.
This commit is contained in:
bchanot committed 2026-11-17 18:17:49 +01:00
1 parent 7a45f1d885
commit 9d03e0675c
1 file changed
+32 -1
+32 -1
View File
@@ -149,11 +149,42 @@ annotation: the markers stay the core's (`view.canvas`) and the drawing is never
modified. The overlay holds numbers only, drawn from the editor's state: the
selection outline (dashed), the vertex circles, the tracing in progress, the
pending or dragged outline, the hollow cross of a corrected position and the
crop rectangle. It sets `pointer-events: none` on its own shapes; the pointer
crop rectangle. It is `aria-hidden` and never takes the pointer. It sets `pointer-events: none` on its own shapes; the pointer
is read on the canvas box and mapped to drawing units through the overlay's
`getScreenCTM().inverse()`. No overlay shape carries `data-anno-id`, so click
targeting still reads the core's markers only.
Handles live in a third `<svg>` of their own (the handle layer), above the
overlay in the same transformed container, with the same `viewBox` and
`preserveAspectRatio`. It is not `aria-hidden`: each handle is a focusable
`role="button"` (`tabindex="0"`) named after what it moves (« Point {nom} » for
a point), with a visible focus ring. The layer's root sets
`pointer-events: none`; each handle's hit shape sets `pointer-events: all` with
a transparent fill and carries `data-handle` (the JSON of its handle
reference), which the press machine reads through `elementsFromPoint`. Handle
sizes are constant in CSS px under zoom: the layer divides them by the drawing's
px per unit (the box size over the frame, times the zoom). The device size is
read once from `(any-pointer: coarse)`:
| Device | Vertex | « + » | « − » bubble | Hit radius |
|---|---|---|---|---|
| Coarse (finger) | 18 px | 24 px | 44 × 36 px | 22 px |
| Fine (mouse, pen) | 12 px | 16 px | none | 10 px |
The point handle covers the selected point's own circle (at least the hit
radius), so the whole marker can be held. A chosen vertex is drawn bigger,
filled and ringed, never by colour alone.
Marks of a gesture in progress, drawn by the overlay:
- the old place: grey dashes of the stored shape while a drag, a move mode, a
size change or a keyboard series shows a preview;
- the preview itself: the selection outline at its new place or size;
- the refused place: red dashes of the shape the core refused, while the
refusal message is shown (the shape stays where it was);
- the move-mode target: the shape the mode moves (the selection, or later the
chosen vertex) keeps its handles; a drag anywhere on the drawing moves it.
The overlay only proposes geometry. Whether a position, a radius or a polygon
is acceptable (frame, minimum visible size, interior) is the core's verdict on
the candidate document; the page keeps no copy of those rules.