diff options
author | detomon <simon@monoxid.ch> | 2024-09-17 11:29:02 +0200 |
---|---|---|
committer | detomon <simon@monoxid.ch> | 2024-09-17 11:40:02 +0200 |
commit | 4e1ae8b768023f3f44c8ec1979719b08b48c3c6c (patch) | |
tree | 0b2d4360136615e7fd1b0d8e09e1f49d31c35f35 | |
parent | 02b16d2f544e323b7b7f57e6e992b0b8e5d8b954 (diff) | |
download | redot-engine-4e1ae8b768023f3f44c8ec1979719b08b48c3c6c.tar.gz |
Fix inconsistency in 3D editor navigation
- Fix typo in orbit/zoom shortcut name
- Fix zoom when using trackpad
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 55649a31dc..ba9fd4e66c 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2012,9 +2012,9 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { int orbit_mod_input_count = _get_shortcut_input_count("spatial_editor/viewport_orbit_modifier_1") + _get_shortcut_input_count("spatial_editor/viewport_orbit_modifier_2"); int pan_mod_input_count = _get_shortcut_input_count("spatial_editor/viewport_pan_modifier_1") + _get_shortcut_input_count("spatial_editor/viewport_pan_modifier_2"); int zoom_mod_input_count = _get_shortcut_input_count("spatial_editor/viewport_zoom_modifier_1") + _get_shortcut_input_count("spatial_editor/viewport_zoom_modifier_2"); - bool orbit_not_empty = !_is_shortcut_empty("spatial_editor/viewport_zoom_modifier_1") || !_is_shortcut_empty("spatial_editor/viewport_zoom_modifier_2"); + bool orbit_not_empty = !_is_shortcut_empty("spatial_editor/viewport_orbit_modifier_1") || !_is_shortcut_empty("spatial_editor/viewport_orbit_modifier_2"); bool pan_not_empty = !_is_shortcut_empty("spatial_editor/viewport_pan_modifier_1") || !_is_shortcut_empty("spatial_editor/viewport_pan_modifier_2"); - bool zoom_not_empty = !_is_shortcut_empty("spatial_editor/viewport_orbit_modifier_1") || !_is_shortcut_empty("spatial_editor/viewport_orbit_modifier_2"); + bool zoom_not_empty = !_is_shortcut_empty("spatial_editor/viewport_zoom_modifier_1") || !_is_shortcut_empty("spatial_editor/viewport_zoom_modifier_2"); Vector<ShortcutCheckSet> shortcut_check_sets; shortcut_check_sets.push_back(ShortcutCheckSet(orbit_mod_pressed, orbit_not_empty, orbit_mod_input_count, orbit_mouse_preference, NAVIGATION_ORBIT)); shortcut_check_sets.push_back(ShortcutCheckSet(pan_mod_pressed, pan_not_empty, pan_mod_input_count, pan_mouse_preference, NAVIGATION_PAN)); @@ -2169,9 +2169,11 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { if (pan_gesture.is_valid()) { NavigationMode nav_mode = NAVIGATION_NONE; - NavigationMode change_nav_from_shortcut = _get_nav_mode_from_shortcut_check(NAVIGATION_LEFT_MOUSE, shortcut_check_sets, true); - if (change_nav_from_shortcut != NAVIGATION_NONE) { - nav_mode = change_nav_from_shortcut; + for (const ShortcutCheckSet &shortcut_check_set : shortcut_check_sets) { + if (shortcut_check_set.mod_pressed) { + nav_mode = shortcut_check_set.result_nav_mode; + break; + } } switch (nav_mode) { |