forked from 1b-agent/opencadstudio-upstream
orbit: turn about the surface under the pointer
With nothing selected, Shift+MMB orbit pivoted on the surface at the view centre, so grabbing a small part off-centre flung the model away. It now pivots on the solid or mesh surface under the pointer where the drag began, falling back to the view centre and then the camera target (#1389). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
bfc9ead28d
commit
6996505d70
2 files changed
+14
-2
No files matched your search
@@ -1436,9 +1436,13 @@ impl OpenCADStudio {
|
||||
if sel.orbit.pivot.is_none() {
|
||||
let scene = &self.tabs[i].scene;
|
||||
let bounds = scene.active_model_tile_bounds(vp_size.0, vp_size.1);
|
||||
// The surface under the pointer where the drag
|
||||
// began, so the model turns about what is grabbed.
|
||||
let grabbed = iced::Point::new(last.x - bounds.x, last.y - bounds.y);
|
||||
sel.orbit.pivot = Some(
|
||||
scene
|
||||
.orbit_pivot()
|
||||
.or_else(|| scene.surface_pivot_at(bounds, grabbed))
|
||||
.or_else(|| scene.view_center_surface_pivot(bounds))
|
||||
.unwrap_or_else(|| scene.camera.borrow().target),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user