fix(paper): keep floating-viewport fills clipped + show lines while editing in MSPACE

Two paper-space rendering fixes:

- The full-canvas sheet instance no longer draws model-block hatches/
  wipeouts/images. Those belong inside the floating content viewports;
  rendering them on the sheet let them bleed past the viewport borders
  when model coords overlapped the paper area. The sheet now draws only
  the paper block's own fills plus the synthetic white printable area.

- Pan/zoom/orbit inside a double-clicked floating viewport (MSPACE) now
  re-culls and re-uploads the viewport's wire set. The per-viewport wire
  cache key now hashes the viewport's own view (pan + zoom + orbit), and
  the active-viewport pan/zoom/orbit handlers bump camera_generation so
  the GPU re-uploads. Previously the stale frustum-culled subset stayed
  on the GPU, so newly-revealed lines were invisible (hatches, uploaded
  as the full set, still showed) until MSPACE was exited.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-03 00:36:28 +03:00
1 parent b7230baae1
commit aec9a9575e
3 files changed
+73 -12

No files matched your search

+16 -10
View File
@@ -650,22 +650,28 @@ impl Scene {
height: visible_h / canvas.1,
};
// The paper sheet instance renders the same hatch / wipeout / image
// fills as everything else (wrong-camera fills fall outside its
// frustum and are culled), plus a synthetic white fill for the sheet's
// printable area — the GPU equivalent of the old PaperCanvas chrome.
let hatches = if inst.paper_sheet {
// The paper sheet instance renders only the paper layout block's own
// fills (plus a synthetic white fill for the printable area) — NOT the
// model-block hatches. Those belong inside the floating content
// viewports; rendering them on the full-canvas sheet would let them
// bleed past the viewport borders whenever model coords overlap the
// paper area. Content viewports keep the full set (the model camera +
// per-viewport scissor place / clip them correctly).
let (hatches, wipeout_hatches) = if inst.paper_sheet {
let mut v: Vec<HatchModel> = Vec::new();
if let Some(sheet) = self.paper_sheet_fill() {
v.push(sheet);
}
v.extend(self.hatch_models_arc().iter().cloned());
Arc::new(v)
v.extend(self.paper_canvas_hatches().iter().cloned());
(Arc::new(v), self.paper_canvas_wipeouts())
} else {
self.hatch_models_arc()
(self.hatch_models_arc(), self.wipeout_models_arc())
};
let images = if inst.paper_sheet {
self.paper_sheet_images()
} else {
self.images_arc()
};
let wipeout_hatches = self.wipeout_models_arc();
let images = self.images_arc();
Some(ViewportData {
wires: all_wires,