mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-26 11:09:23 -06:00
crates/engine/src/print/layout.rs is the pure page model the Print module builds on: ten named papers plus custom, orientation, margins and the printable area; Single Image, Contact Sheet (grid with spacing and square cells), Picture Package and Custom Package styles; package cells with a stacking order (send to back / backward / forward / bring to front); a deterministic MaxRects packer behind Auto Layout (largest first, earlier pages filled before a new one opens, a cell turned a quarter only when it fits nowhere as given); snap-to-cells and snap-to-grid helpers; ruler units and guide options. All lengths are inches in page space, after orientation. Every number from outside is checked (NaN, infinity, negative, oversized, cell and page caps) and Layout::validate guards saved layouts. No command or UI reaches it yet, so the parity rows keep their status.