Add Touchpad navigation: Shift to pan, Alt/Option to orbit (#1220)
An opt-in Touchpad navigation preset: Shift + pointer motion pans, Alt/Option + motion orbits, vertical scroll zooms, all without a mouse button. Existing presets are unchanged; view.navigate gains continuous motion for the control channel and scenarios.
This commit is contained in:
1 parent
b4edf05373
commit
bd8db8ea1c
17 files changed
+717
-60
No files matched your search
@@ -197,6 +197,13 @@ fn edge_bisector(m: &Mesh, index: usize, p: Vec3) -> Option<Vec3> {
|
||||
sum.normalized()
|
||||
}
|
||||
|
||||
/// Whether a dynamically registered canvas handle owns this point before navigation.
|
||||
pub(crate) fn owns_pointer(app: &SolveApp, proj: &Proj, p: Pos2) -> bool {
|
||||
// The triad only registers an egui hit widget after a handle is under the pointer.
|
||||
// Test its geometry before navigation, including the first frame entering a handle.
|
||||
app.dialog.as_ref().and_then(|d| crate::dialogs_move::triad(app, d)).is_some_and(|t| crate::gizmo::contains_pointer(proj, &t, p))
|
||||
}
|
||||
|
||||
/// Draw the manipulator and the value box (called by the viewport after the model is drawn).
|
||||
pub fn show(app: &mut SolveApp, ui: &mut egui::Ui, painter: &egui::Painter, proj: &Proj) {
|
||||
// While OK computes, the inputs hold what it computes: no arrow to drag, no box to type in.
|
||||
|
||||
Reference in new issue
Block a user