forked from 1b-agent/opencadstudio-upstream
Merge pull request #1299: Add Windows SpaceMouse navigation
This commit is contained in:
commit
af847ad92e
32 files changed
+3508
-12
No files matched your search
+13
-3
@@ -10921,11 +10921,21 @@ vis_index={:.1} visible_probe={:.1}",
|
||||
/// when something is selected. `None` keeps the current camera target as
|
||||
/// the orbit centre. (#229)
|
||||
pub fn orbit_pivot(&self) -> Option<glam::DVec3> {
|
||||
self.navigation_selection_bounds()
|
||||
.map(|(min, max)| (min + max) * 0.5)
|
||||
}
|
||||
|
||||
pub(crate) fn navigation_selection_bounds(&self) -> Option<(glam::DVec3, glam::DVec3)> {
|
||||
if self.selected.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let block = self.current_layout_block_handle();
|
||||
let scale = if self.current_layout == "Model" {
|
||||
let model_view = self.current_layout == "Model" || self.active_viewport.is_some();
|
||||
let block = if self.active_viewport.is_some() {
|
||||
self.model_space_block_handle()
|
||||
} else {
|
||||
self.current_layout_block_handle()
|
||||
};
|
||||
let scale = if model_view {
|
||||
crate::scene::annotative::scale_handle_by_name(
|
||||
&self.document,
|
||||
&self.document.header.current_annotation_scale,
|
||||
@@ -10982,7 +10992,7 @@ vis_index={:.1} visible_probe={:.1}",
|
||||
}
|
||||
}
|
||||
if any {
|
||||
Some((min + max) * 0.5)
|
||||
Some((min, max))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user