feat(ui): unified viewport control chip + per-tile grid rendering

Move grid and grid-snap toggles off the status bar (and its customization
menu) into the top-left viewport chip, now a single container holding the
horizontal/vertical split buttons, render-mode picker, and grid/snap
toggles, sized to the render-mode picker. Add grid + magnet (snap) icons.

Render the grid per model tile from each tile's own grid_on, in its own
bounds and camera, instead of a single grid in the active tile. This stops
the grid flickering on/off as the cursor crosses panes or leaves the
viewport, and lets each pane show its own grid independently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-18 23:29:34 +03:00
1 parent d4a665a34c
commit 9eb805df23
8 files changed
+170 -133

No files matched your search

+6 -8
View File
@@ -107,7 +107,7 @@ pub fn selection_overlay<'a>(
selection: SelectionState,
snap: Option<(Point, SnapType)>,
grips: Vec<GripMarker>,
grid: Option<GridParams>,
grid: Vec<GridParams>,
ucs_icon: Option<UcsIconParams>,
ost_points: Vec<OstTrackPoint>,
cursor_screen: Point,
@@ -134,7 +134,7 @@ struct SelectionCanvas {
selection: SelectionState,
snap: Option<(Point, SnapType)>,
grips: Vec<GripMarker>,
grid: Option<GridParams>,
grid: Vec<GridParams>,
ucs_icon: Option<UcsIconParams>,
ost_points: Vec<OstTrackPoint>,
cursor_screen: Point,
@@ -284,13 +284,11 @@ impl canvas::Program<Message> for SelectionCanvas {
}
// ── Grid display ──────────────────────────────────────────────────
if let Some(ref g) = self.grid {
// Clip to the active tile's rectangle so grid lines don't spill
// into neighbouring panes in a tiled layout.
let plane = g.plane;
let view_proj = g.view_proj;
// One entry per pane with its grid on. Each is clipped to its own tile
// rectangle so lines never spill into neighbouring panes.
for g in &self.grid {
let gb = g.bounds;
frame.with_clip(gb, |f| draw_grid(f, view_proj, plane, gb));
frame.with_clip(gb, |f| draw_grid(f, g.view_proj, g.plane, gb));
}
if let (Some(a), Some(b)) = (self.selection.box_anchor, self.selection.box_current) {