Draw the view orthographic while a sketch is open (#1758)

Thanks @pablopeza.
This commit is contained in:
Pablo López authored and GitHub committed 2026-10-17 06:48:42 -04:00
1 parent e052d19879
commit 40bdc1132e
2 files changed
+25 -3

No files matched your search

+7 -1
View File
@@ -976,6 +976,12 @@ impl SolveApp {
self.dialog.as_ref().is_some_and(|d| matches!(d.kind, dialogs::Kind::Sketch))
}
/// Is the view drawn in perspective? The perspective preference, except while a sketch is
/// open: a sketch is drawn and measured on its plane, so the view is parallel (no foreshortening).
pub fn perspective_view(&self) -> bool {
self.ui.perspective && self.session.active_sketch.is_none()
}
pub fn set_status(&mut self, s: impl Into<String>, error: bool) {
self.status = Some((s.into(), now_ms(), error));
}
@@ -1077,7 +1083,7 @@ impl SolveApp {
fn fitted_bounds(&self, mut cam: Camera, bounds: &solidcraft_engine::geom::Aabb3) -> Camera {
if let Some(layout) = &self.viewport.layout {
return viewport_layout::fit_bounds(cam, bounds, layout, self.ui.perspective).unwrap_or(cam);
return viewport_layout::fit_bounds(cam, bounds, layout, self.perspective_view()).unwrap_or(cam);
}
let previous = cam;
cam.fit(bounds);