Expand description
The editor’s own rules about grid geometry: the block-height ladder, a
block’s pin capacity, the accent↔role mapping the pickers speak, and the
label and asset reads the shapes draw from. The coordinate conversions these
build on are crate::grid’s, so a rect drawn and a rect committed cannot
disagree about where a cell is.
Functions§
- accent_
from_ role - The inverse of
role_from_accent, for projections back into the picker’s vocabulary. - asset_
within_ limit - Whether
assetis small enough to ride the commit log; logsnameand both sizes when it is not. The fold refuses one too, but only after a gesture has authored it — refusing here is what lets the pick that produced it say so. - block_
rect grid_recton a block’s height ladder: heights are one of 4, 7, 10, … cells (a pin slot’s clearance plus one pitch per slot), and the top edge is kept, so the block settles onto the nearest valid height rather than the one the drag stopped at.- role_
from_ accent - The picker’s accent pick —
None= plain,Some(0..=7)= palette index — onto the 9-variantRole, whereAccent0is the meaningful plain default. Indices past the palette cannot come from the picker; they saturate to the last accent rather than silently reading as plain. - shape_
label - A
Labelnamespace read out for drawing. The one register the geometry layer cannot use as stored isoffset: the document keeps it fixed-point (so its bytes are deterministic), while every anchor formula works in world pixels — the same pixels the drag wrote, sinceFracVal::from(f32)is what put it there. - slot_
capacity - The highest slot a block
heightcells tall offers; the ladder itself lives inmax_pin_slot, which works in px.