From b73a97b110693a9cbd6ea01f652104cbf0617cb9 Mon Sep 17 00:00:00 2001 From: jmb462 Date: Sat, 13 Mar 2021 20:45:14 +0100 Subject: [PATCH] Fix hardcoded Maya style navigation pan key modifier ALT key modifier was hardcoded is node_3d_editor_plugin.cpp and didn't take editor settings into account. Fix #46973 (cherry picked from commit 31077d875ea9f778d960d9bdfbc6affbab54081a) --- editor/plugins/spatial_editor_plugin.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 70d5711fdcd..8c1152b7250 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -1847,10 +1847,8 @@ void SpatialEditorViewport::_sinput(const Ref &p_event) { } else if (m->get_button_mask() & BUTTON_MASK_MIDDLE) { + const int mod = _get_key_modifier(m); if (nav_scheme == NAVIGATION_GODOT) { - - const int mod = _get_key_modifier(m); - if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) { nav_mode = NAVIGATION_PAN; } else if (mod == _get_key_modifier_setting("editors/3d/navigation/zoom_modifier")) { @@ -1861,8 +1859,9 @@ void SpatialEditorViewport::_sinput(const Ref &p_event) { } } else if (nav_scheme == NAVIGATION_MAYA) { - if (m->get_alt()) + if (mod == _get_key_modifier_setting("editors/3d/navigation/pan_modifier")) { nav_mode = NAVIGATION_PAN; + } } } else if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_3_button_mouse")) {