From 244f951c004c94014dbd8b8a281d927380da47ec Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 25 Jun 2026 18:55:20 +0300 Subject: [PATCH] fix(viewport): show new paper-space viewport border without a zoom Creating a viewport in a layout commits through document.add_entity_to_layout + Scene::auto_fit_viewport, both of which skip the geometry-cache bump that Scene::add_entity performs for every other entity. So the new viewport's border wasn't tessellated until the next zoom/pan happened to invalidate the cache. Bump the wire tessellation (no-blocks: a viewport touches no block definitions) right after the viewport is added. Co-Authored-By: Claude Opus 4.8 --- src/app/properties.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/properties.rs b/src/app/properties.rs index 909aec0f7..9890d8153 100644 --- a/src/app/properties.rs +++ b/src/app/properties.rs @@ -687,6 +687,12 @@ impl OpenCADStudio { { Ok(new_handle) => { self.tabs[i].scene.auto_fit_viewport(new_handle); + // Adding a viewport straight onto the document layout + // bypasses Scene::add_entity, which is what normally + // invalidates the wire-tessellation cache. Without this the + // new viewport's border isn't tessellated until the next + // zoom/pan forces a rebuild. + self.tabs[i].scene.bump_geometry_no_blocks(); Some(new_handle) } Err(e) => {