feat: per-viewport grid/snap, adopted from the active viewport

Make grid-snap a per-drawing view setting like grid visibility: drop it
from the persisted OSNAP set (settings.txt) and round-trip it through each
viewport's VPort SNAPMODE instead.

Grid display and grid-snap are now stored per model tile (like render
mode), written to and read from each tile's *Active VPort entry. The live
toggles mirror the active tile, and grid/snap are adopted from the active
viewport whenever it changes — on file load, tab switch, model-tile
activation, and new drawing — so they follow the active viewport rather
than a global preference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-18 22:25:44 +03:00
commit d4a665a34c
3 changed files with 80 additions and 56 deletions

View file

@ -27,7 +27,9 @@ const SNAP_ORDER: &[SnapType] = &[
SnapType::Nearest,
SnapType::ApparentIntersection,
SnapType::Parallel,
SnapType::Grid,
// Grid snap (SNAPMODE) is a per-drawing view setting stored on the VPort,
// not a global OSNAP preference, so it is deliberately excluded from the
// persisted set. (#121)
];
fn snap_id(s: SnapType) -> &'static str {