feat: inline MSPACE viewport overlay on 2D paper canvas

- viewport_screen_rect now mirrors PaperCanvas::draw()'s camera-based
  to_px transform instead of using a fixed paper-limits scale, so the
  3D overlay lands exactly over the drawn viewport border at any zoom/pan

- blue border frame (stack layer above the shader) makes the active
  viewport boundary always visible even when it fills the canvas

- space-mode pill in MSPACE now dispatches LayoutSwitch("Model") so
  clicking it jumps to full Model Space instead of just exiting to PSPACE

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-23 13:57:34 +03:00
commit fcc29de469
3 changed files with 63 additions and 29 deletions

View file

@ -92,7 +92,7 @@ impl StatusBar {
osnap_btn(osnap_active, snapper.snap_enabled, popup_open),
tip(
space_mode_btn(&current_layout, in_mspace),
"Toggle Model/Paper space\nDouble-click viewport to enter MSPACE",
"PAPER: double-click viewport to enter MSPACE\nMODEL: click to switch to Model Space",
),
status_pill(scale_label),
]
@ -460,9 +460,9 @@ fn space_mode_btn(current_layout: &str, in_mspace: bool) -> Element<'static, Mes
// PAPER = currently in paper-space editing
// MODEL = currently in model-space editing (either the Model tab or MSPACE)
let (label, active, on_press) = if is_model_tab {
("MODEL", false, None)
("MODEL", false, None::<Message>)
} else if in_mspace {
("MODEL", true, Some(Message::ExitViewport))
("MODEL", true, Some(Message::LayoutSwitch("Model".to_string())))
} else {
("PAPER", false, Some(Message::MspaceCommand))
};