diff options
| author | Andreas Haas | 2016-12-03 21:38:49 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-01-12 19:15:27 +0100 |
| commit | 5bfd0bbe5e6b35aa212510a8961a5ebe2fb59842 (patch) | |
| tree | 48e79684c8dd3d374990c2184146bb4bd2cd160a | |
| parent | fa816730c0d82d4c994472be18fd0f8b6935993e (diff) | |
| download | godot-5bfd0bbe5e6b35aa212510a8961a5ebe2fb59842.tar.gz godot-5bfd0bbe5e6b35aa212510a8961a5ebe2fb59842.tar.zst godot-5bfd0bbe5e6b35aa212510a8961a5ebe2fb59842.zip | |
TextureRegionEditor: Fix mouse wheel scroll speed.
Any given mouse wheel input will generate two InputEvents in godot.
The zoom methods here acted on both ones, effectively giving a step value of 4 instead of 2.
Fixes #7236
(cherry picked from commit c2040324beea92dcf7b44be5f4827257bd872d00)
| -rw-r--r-- | tools/editor/plugins/texture_region_editor_plugin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp index 4a24c4d34..9348f683f 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/tools/editor/plugins/texture_region_editor_plugin.cpp @@ -388,9 +388,9 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) drag_index = -1; } } - } else if (mb.button_index == BUTTON_WHEEL_UP) { + } else if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) { _zoom_in(); - } else if (mb.button_index == BUTTON_WHEEL_DOWN) { + } else if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) { _zoom_out(); } } else if (p_input.type==InputEvent::MOUSE_MOTION) { |
