feat(viewport): draggable Model-tile dividers

Tiled Model layouts now show the inner edges between panes as 2-px
dividers that act as resize grips: cursor on a divider → resize cue,
press + drag moves the edge (with every tile sharing that edge
updating together), release runs a collapse pass that absorbs any
tile that fell below the viewcube-comfort minimum into the neighbour
with the longest shared contact edge — drag a divider all the way
across to remove a pane.

- Scene grows `model_tile_edges`, `hit_model_tile_edge`,
  `move_model_tile_edge`, `collapse_small_model_tiles`. Edges are
  derived from the existing `model_tiles` rects (no extra storage).
- App carries a `tile_drag` Option; `ViewportLeftPress` starts it
  ahead of tile activation / picking, `ViewportMove` drives the
  edge, `ViewportLeftRelease` collapses + clears.
- `SelectionCanvas` draws the dividers and switches the cursor to
  `Resizing{Horizontally, Vertically}` over them.
This commit is contained in:
Hakan Seven 2026-05-28 18:42:39 +03:00
commit 39eab9a4c4
5 changed files with 550 additions and 2 deletions

View file

@ -371,6 +371,13 @@ impl OpenCADStudio {
vec![]
};
// Model-space tile dividers (none in paper / single-tile layouts).
let tile_edges = if !is_paper {
tab.scene.model_tile_edges()
} else {
vec![]
};
overlay::selection_overlay(
sel,
snap_info,
@ -380,6 +387,7 @@ impl OpenCADStudio {
ost_points,
tab.last_cursor_screen,
!is_paper && self.show_viewcube,
tile_edges,
)
};