Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

View axes: only a plain drag on the disc orbits; Alt / Ctrl / Shift drags starting there keep pan, mask, roll (pen navigation tests)

islandmed306ef0e9b813
diff --git a/src/app/App.cpp b/src/app/App.cpp
index 8fa66b5c..21cb0bf5 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -4113,12 +4113,14 @@ bool App::overViewNavigator(float x, float y) const {
bool App::axisGizmoMouseDown(float x, float y) {
// A click on an end snaps to that side view, orthographic (#43, as in Blender's navigation gizmo), a second click
- // on it to the opposite side; a drag on the disc behind the ends orbits; a click on the View Figure snaps to
+ // on it to the opposite side; a plain drag on the disc behind the ends orbits; a click on the View Figure snaps to
// the side view nearest the current one.
const auto ends = axisGizmoLayout();
const float unit = axisGizmoUnit();
int hit = uiPrefs_.showAxes ? axisGizmoSnapEnd(ends, axisGizmoHit(ends, x, y, kAxisGizmoHitRadius * unit)) : -1;
- if (hit < 0 && uiPrefs_.showAxes && axisGizmoOnDisc(axisGizmoCentre(), kAxisGizmoDisc * unit, x, y)) {
+ // Only a plain press: Alt / Ctrl / Shift drags starting there keep their meaning (pan, mask, roll...).
+ const bool plain = !((SDL_GetModState() | keyMods()) & (SDL_KMOD_SHIFT | SDL_KMOD_CTRL | SDL_KMOD_ALT | SDL_KMOD_GUI));
+ if (hit < 0 && plain && uiPrefs_.showAxes && axisGizmoOnDisc(axisGizmoCentre(), kAxisGizmoDisc * unit, x, y)) {
drag_ = Drag::Orbit;
rightClick_.pending = false;
return true;
diff --git a/tests/ui/view_axes.sfui b/tests/ui/view_axes.sfui
index fa425ae1..ddf6ef4d 100644
--- a/tests/ui/view_axes.sfui
+++ b/tests/ui/view_axes.sfui
@@ -130,3 +130,11 @@ key escape
shot with_view_figure
view_figure_click
expect_value camera_aligned == 1
+
+# Alt+drag starting on the disc still pans (only a plain drag there orbits).
+camera 35 -25
+remember camera_pan p0
+hold alt
+axis_drag 0 60
+hold none
+expect_value camera_pan > $p0