forked from 1b-agent/opencadstudio-upstream
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 <[email protected]>
This commit is contained in:
1 parent
b7230baae1
commit
aec9a9575e
3 files changed
+73
-12
No files matched your search
@@ -1950,6 +1950,9 @@ impl OpenCADStudio {
|
||||
sel.right_last_pos = Some(p);
|
||||
drop(sel);
|
||||
self.tabs[i].scene.orbit_active_viewport(dx, dy);
|
||||
// Bump so the GPU re-uploads the viewport's
|
||||
// re-culled wire set after the view rotates.
|
||||
self.tabs[i].scene.camera_generation += 1;
|
||||
return Task::none();
|
||||
} else if self.tabs[i].scene.current_layout == "Model" {
|
||||
sel.right_last_pos = Some(p);
|
||||
@@ -1986,6 +1989,10 @@ impl OpenCADStudio {
|
||||
drop(sel);
|
||||
if self.tabs[i].scene.active_viewport.is_some() {
|
||||
self.tabs[i].scene.pan_active_viewport(dx, dy, bounds);
|
||||
// Bump so the GPU re-uploads the viewport's re-culled
|
||||
// wire set — otherwise newly-revealed lines stay
|
||||
// invisible until MSPACE is exited.
|
||||
self.tabs[i].scene.camera_generation += 1;
|
||||
} else {
|
||||
// `bounds` is the active tile; pan by its height so
|
||||
// the point under the cursor tracks correctly.
|
||||
@@ -3169,6 +3176,9 @@ impl OpenCADStudio {
|
||||
glam::Vec2::new(pt.x, pt.y)
|
||||
});
|
||||
self.tabs[i].scene.zoom_active_viewport(s, cursor_paper);
|
||||
// Bump so the GPU re-uploads the viewport's re-culled wire
|
||||
// set after zooming inside it.
|
||||
self.tabs[i].scene.camera_generation += 1;
|
||||
} else {
|
||||
// Model space: zoom about the cursor within the active
|
||||
// tile so the point under it stays put in that pane.
|
||||
|
||||
Reference in new issue
Block a user