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
@@ -567,6 +567,9 @@ impl Scene {
|
||||
viewport.view_target.x = center.x;
|
||||
viewport.view_target.y = center.y;
|
||||
viewport.view_target.z = center.z;
|
||||
// Panning a viewport moves model geometry across the sheet; the
|
||||
// dimensions drawn through it follow.
|
||||
self.notify_viewport_changed(handle);
|
||||
} else {
|
||||
self.camera.borrow_mut().target = center;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user