mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-24 10:27:00 -06:00
A behaviour suite for canvas navigation, rulers, guides, layout grids, outline mode and measuring (`crates/engine/src/view_behaviour_tests.rs`, 18 tests, ~120 table rows and checks), written from the public documentation with a one-line derivation per case; where the documentation is silent the case says so and pins today's behaviour. Plus the fixes it found: - **Pixel grid** shows from 400% (it waited for 800%). The threshold, pixel preview's resolution and wheel panning (`ViewState::pixel_grid_shown`, `pixel_preview_scale`, `scroll`) now live in the engine; the canvas calls them. - **Guides belong to the page or a top-level frame.** A guide dropped over a nested frame goes to the frame holding it (`guides::drop_owner`), `guide.add` refuses nested frames, and a frame moved into another frame keeps its guides but they stop drawing, snapping and measuring. - **Selecting guides:** a click selects a guide (`guide.select`, new command, Spanish label added); Delete/Backspace removes it, the arrows across it nudge it (Shift: big nudge), Escape deselects; right-click opens the context menu with Remove guide (`guide.remove` without an index removes the selected guide). A click without a move no longer records an empty undo step. - **Alt-drag** on a guide drops a copy; **holding Alt while dragging** a guide shows its distances to the nearest edges inside the frame it crosses (`distance::from_guide`). - **Layout grids:** columns/rows with a fixed width and count 0 are **Auto** (as many as fit; the Count field shows Auto); grids don't show or snap on a **rotated frame**. - **Outline mode:** shapes are hit on their outlines, so a click reaches layers drawn behind (`geometry::hit_outlines`).