fix(viewports): share command previews

Closes #548
This commit is contained in:
Hakan Seven 2026-07-29 23:26:06 +03:00
commit 8d5ccdbd25

View file

@ -2094,15 +2094,15 @@ impl Scene {
// per-frame buffer so the (potentially huge) base buffer stays resident // per-frame buffer so the (potentially huge) base buffer stays resident
// and unchanged while a command preview or grip drag is live. // and unchanged while a command preview or grip drag is live.
let all_wires = other_arc; let all_wires = other_arc;
// A live overlay belongs to exactly one drawing context. In a paper // A live overlay belongs to one drawing space, but every viewport that
// layout, feeding model-space preview coordinates to the full-canvas // displays that space must project the same world-space preview. In a
// sheet pass draws a second copy outside the floating viewport (#540). // paper layout, model-space overlays go to all content viewports while
// The inverse is equally wrong: paper-space coordinates must not be // paper-space overlays stay on the sheet. This also keeps model-space
// interpreted by a content viewport's model camera. // coordinates out of the full-canvas sheet pass (#540).
let show_live_overlay = if self.current_layout == "Model" { let show_live_overlay = if self.current_layout == "Model" {
inst.active true
} else if let Some(active_viewport) = self.active_viewport { } else if self.active_viewport.is_some() {
!inst.paper_sheet && inst.handle == active_viewport !inst.paper_sheet
} else { } else {
inst.paper_sheet inst.paper_sheet
}; };