feat(ui): offer a cube navigator alongside signed axes (#664)
Adds a View navigator preference (Navigation page) with an optional cube navigator alongside the signed axes, which stay the default (#165).
This commit is contained in:
1 parent
aa24d9f071
commit
7b34d57b25
15 files changed
+1344
-93
No files matched your search
@@ -465,6 +465,16 @@ impl SolveApp {
|
||||
let r = self.session.execute(id, ¶ms).map_err(|e| e.to_string());
|
||||
self.big_operation |= now_ms() - t0 >= recovery_ui::BIG_OPERATION_MS;
|
||||
if let Ok(v) = &r {
|
||||
if id == "view.navigate" {
|
||||
let to: Camera = serde_json::from_value(v.get("camera").cloned().unwrap_or_default()).map_err(|e| e.to_string())?;
|
||||
if v.get("fit").and_then(Value::as_bool).unwrap_or(false) {
|
||||
let bounds = solidcraft_engine::view::bounds(&self.session);
|
||||
self.animate_to(self.fitted(to));
|
||||
self.pending_fit = Some((to, bounds, true));
|
||||
} else {
|
||||
self.animate_to(to);
|
||||
}
|
||||
}
|
||||
// Curves drawn in construction (or centerline) mode take that line type.
|
||||
sketch_palette::apply_mode(self, id, v);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user