fix(view): preserve projection framing

Use full 3D bounds to derive a safe perspective eye distance without changing the camera target, orientation, or field of view.

Refs #502
This commit is contained in:
Hakan Seven 2026-08-05 12:47:46 +03:00
commit e07f4f959b
5 changed files with 219 additions and 19 deletions

View file

@ -1227,8 +1227,9 @@ impl OpenCADStudio {
Projection::Perspective
};
let i = self.active_tab;
self.tabs[i].scene.camera.borrow_mut().projection = proj;
self.tabs[i].scene.camera_generation += 1;
self.tabs[i]
.scene
.set_projection_preserving_frame(proj);
self.ribbon.set_ortho(ortho);
self.command_line.push_output(if ortho {
"Projection: Orthographic"