Expand description
The editing model behind any Litz frontend.
This crate owns the document — parts, wires and the undo history — and knows nothing about pixels, DOM or a particular UI toolkit. A browser canvas, a native window and a test can all drive the same operations.
Every mutation goes through Editor::transact: the new circuit is built
off to the side, validated, and only then committed. A refused edit leaves
the document and its history untouched, which is what an undo stack needs
to stay honest.
Geometry is presentation only. route_wire produces an orthogonal path
for drawing; nothing here feeds a simulation.
Structs§
Enums§
- Edit
Error - Why an edit was refused.
Constants§
- GRID
- The grid a wire and a part snap to, in canvas units.
Functions§
- route_
wire - An orthogonal path from
fromtoto, snapped to the grid. - snap
- Snap a coordinate to the nearest grid intersection.