Browse Source

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
Andreas Haas 8 years ago
parent
commit
c2040324be
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tools/editor/plugins/texture_region_editor_plugin.cpp

+ 2 - 2
tools/editor/plugins/texture_region_editor_plugin.cpp

@@ -388,9 +388,9 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input)
 					drag_index = -1;
 					drag_index = -1;
 				}
 				}
 			}
 			}
-		} else if (mb.button_index == BUTTON_WHEEL_UP) {
+		} else if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) {
 			_zoom_in();
 			_zoom_in();
-		} else if (mb.button_index == BUTTON_WHEEL_DOWN) {
+		} else if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) {
 			_zoom_out();
 			_zoom_out();
 		}
 		}
 	} else if (p_input.type==InputEvent::MOUSE_MOTION) {
 	} else if (p_input.type==InputEvent::MOUSE_MOTION) {