Expand description
Geometry value types for the document model.
No floats anywhere: coordinates are integers (GridPoint) or fixed-point
(FracVal), so every value has exactly one encoding and the bytes the
change hash covers are deterministic.
Structs§
- FracVal
- An
f32quantized to units of 2⁻²⁴ (truncated toward zero), stored asi64. NOTE:f32 -> FracValon NaN saturates to 0 (Rustascast). Reject NaN at command construction (debug_assert) rather than relying on saturation. - Grid
Point - Grid
Rect - Atomic wherever it appears — one register holds the whole rect.
- Grid
Size - GridVec
- A grid-space delta. Deliberately not serializable: deltas never cross the wire — commits carry the absolute values a delta produced.
- PinSlot
- Where a pin sits on its block-as-child: an edge and a slot index (slots, not cells — the pitch is the editor’s concern). Atomic: a slot is one author’s intent, and split registers could merge to an edge one write chose and an offset another did.
- RawGrid
Point 🔒 - Mirrors
GridPointsotry_fromhas an unchecked type to decode into first — serde’s price for a validating decode. - RawGrid
Size 🔒 - RawPin
Slot 🔒 - Screen
Point - Screen
Rect - Atomic (same reasoning as
GridRect). Default = empty rect (meaningful zero). - Screen
Size - Waypoint
- The lock rides inside the atomic waypoints value: a polyline with its locks is one author’s coherent intent.
Enums§
Constants§
- GRID_
LIMIT - The document extent, in grid cells: two of them sum far inside
i32, so no rect accessor can overflow a value a decoder accepted. Enforced at the decode boundary, where “bounded by the document extent” stops being true because the payload came from a stranger. Refused, never clamped — clamping relocates geometry instead of reporting a bad payload. Authoring must respect it too, or it writes commits it cannot read back.