docs(docs): V1-2.2 view frame rule in RUST.md 12.11, contract, rendering

This commit is contained in:
bchanot committed 2026-10-30 20:54:46 +01:00
1 parent 0c87c7f6c3
commit faa53c7956
3 files changed
+52 -8

No files matched your search

+14 -7
View File
@@ -65,13 +65,20 @@ changeset, never by the renderer.
## Views
A view renders on its `view_box` when set (the head view is the crop
`60 100 500 380` of the main drawing). Otherwise the canvas keeps the asset's
own `viewBox`, and falls back to `0 0 100 100` when the asset has none; the PDF
engine keeps whatever the asset has. A detail view with its own
`svg_asset_id` renders that asset, otherwise the first asset up its parent
chain. The root's `width` and `height` are removed; its other attributes are
kept (after sanitising).
A view renders on its frame (`anatomy::frame::view_frame`, V1-2.2 owner brief
2026-10-30): its `view_box` when set (the head view is the crop
`60 100 500 380` of the main drawing), otherwise the asset's own `viewBox` read
as a browser reads it (four numbers, positive width and height) and written
back in JavaScript number printing (`0,0,10,10` becomes `0 0 10 10`). Without
a usable frame the canvas falls back to `0 0 100 100` and the PDF view carries
no `viewBox`. A detail view with its own `svg_asset_id` renders that asset,
otherwise the first asset up its parent chain. The root's `width`, `height`
and `preserveAspectRatio` are removed (the default `xMidYMid meet` shows the
whole frame, which a `slice` would crop where the box is not the frame's); its
other attributes are kept (after sanitising). The verdict and the preview
refuse an annotation not entirely inside this same frame
(`verification.validation.out_of_frame`), so a drawing whose `viewBox` moved
away from the annotations is refused, never drawn without its markers.
The editor canvas is inlined in the page, where `#id` resolves against the
whole document. Since V1-2.2 (owner decision 2026-10-29) the core writes