forked from 1b-agent/opencadstudio-upstream
Regenerate viewport dimensions when the viewport view changes
Panning, zooming, twisting or rescaling a layout viewport moves model geometry across the sheet without touching that geometry, so nothing in the ordinary entity-change path noticed and the dimensions drawn through the viewport stayed where they were — detached from what they measure. `Scene::notify_viewport_changed` announces the viewport itself as a modified entity. That is all it takes: every trans-space reference carries the viewport handle as the first link of its chain, so the dependency lookup in `refresh_associative_dimensions` already finds the associations from there, and the refresh re-places and re-measures them. Called from each mutator that changes the paper<->model mapping: pan, zoom, fit-to-bounds, view normalisation on entering MSPACE, the view-direction/twist snaps, the viewcube camera path, and both annotation-scale setters. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
e8246031fd
commit
f80130560e
3 files changed
+32
-2
No files matched your search
@@ -5296,6 +5296,10 @@ impl Scene {
|
||||
self.document
|
||||
.set_viewport_annotation_scale(viewport, scale_handle);
|
||||
|
||||
// Viewport scale changed: the dimensions drawn on the sheet
|
||||
// through it measure the same model geometry at a new paper
|
||||
// size and have to be re-placed.
|
||||
self.notify_viewport_changed(viewport);
|
||||
self.resident_wire_sets.borrow_mut().clear();
|
||||
self.bump_geometry();
|
||||
|
||||
@@ -5349,6 +5353,10 @@ impl Scene {
|
||||
vp.view_height = vp.height / factor;
|
||||
self.document
|
||||
.set_viewport_annotation_scale(viewport, scale_handle);
|
||||
// Viewport scale changed: the dimensions drawn on the sheet
|
||||
// through it measure the same model geometry at a new paper
|
||||
// size and have to be re-placed.
|
||||
self.notify_viewport_changed(viewport);
|
||||
self.resident_wire_sets.borrow_mut().clear();
|
||||
self.bump_geometry();
|
||||
true
|
||||
|
||||
Reference in new issue
Block a user