Expand description
The geometry layer: where a shape’s parts land on the canvas, how big they are, and how they paint.
Deliberately document-agnostic. Every type here is handed the entities
it draws — a block arrives with its pins, an image with its bytes, a text
box with its measured extent — so nothing in this module looks anything
up. The caller that knows the scope resolves those (see
Drawing), which is also what keeps a
pin drawn as a boundary port and the same pin drawn as a stub on its
block from needing two data shapes.
Re-exports§
pub use block::BlockShape;pub use image::Artwork;pub use port::PortShape;pub use text_box::TextShape;
Modules§
- area
- block
- image
- pin
- The pin vocabulary the geometry layer draws in: the document’s pin entity and its value enums, plus the derived readings the drawing and hit-test paths take off a pin’s registers.
- port
- text_
box
Structs§
- PinLocation
- Shape
Label - A
blockworx_doc::block_model::Labelnamespace resolved for drawing: its four registers read out, with the offset converted from the document’s fixed-point to the world pixels every anchor formula works in (shape_labelis the one conversion). Borrowed andCopy, so a drag preview builds its shifted twin with a struct update instead of cloning the name.
Enums§
- Deletable
- Something the user can delete: a shape (child block or boundary port), a route, a whole multi-selection of shapes, or a group of child-block pins.
- Role
Target - A shape that carries an accent
rolethe picker can target: a child block, a boundary port, a route, a boundary area, or a text box. - ShapeId
- A unified ID that can refer to a child block (
BlockId), a port-pin on the current block (PinId), a free-floating text annotation (TextId), a boundary area (AreaId), a free-floating background image (ImageId), or a block’s foreground icon (keyed by the owningBlockId). - Shape
Ref - A borrowed reference to any shape, bundled with whatever the geometry
layer needs beside the entity itself: a block’s pins, a port’s own id, a
text box’s measured extent, artwork’s bytes. Because this is a concrete
enum (not a trait object), methods with generic parameters (e.g.
with_pins) work naturally — dispatch is viamatch, not a vtable.
Traits§
- Base
Shape BaseShapeis what every shape can answer without knowing the document: where it sits, what its labels are, where its pins hang, and how it paints. Writes are not here — they are commits, emitted bycrate::editagainst the document the gesture read.