summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-20 17:16:52 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-20 17:16:52 -0300
commit85d8000449be06affcd686838d498be186594c14 (patch)
tree9f36273a3e8334ab19af561d94bea2afd079ee32
parent6bdd17f07c37db678f1d4e915cf121ad085096d4 (diff)
Allow mouse wheel to go throuhgh so scroll containers work properly, fixes #4431
-rw-r--r--scene/main/viewport.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 3bb3a70468..2afb8374f8 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1574,6 +1574,14 @@ void Viewport::_gui_call_input(Control *p_control,const InputEvent& p_input) {
// _block();
+
+ //mouse wheel events can't be stopped
+ bool cant_stop_me_now = (p_input.type==InputEvent::MOUSE_BUTTON &&
+ (p_input.mouse_button.button_index==BUTTON_WHEEL_DOWN ||
+ p_input.mouse_button.button_index==BUTTON_WHEEL_UP ||
+ p_input.mouse_button.button_index==BUTTON_WHEEL_LEFT ||
+ p_input.mouse_button.button_index==BUTTON_WHEEL_RIGHT ) );
+
CanvasItem *ci=p_control;
while(ci) {
@@ -1589,7 +1597,7 @@ void Viewport::_gui_call_input(Control *p_control,const InputEvent& p_input) {
break;
if (gui.key_event_accepted)
break;
- if (control->data.stop_mouse && (p_input.type==InputEvent::MOUSE_BUTTON || p_input.type==InputEvent::MOUSE_MOTION))
+ if (!cant_stop_me_now && control->data.stop_mouse && (p_input.type==InputEvent::MOUSE_BUTTON || p_input.type==InputEvent::MOUSE_MOTION))
break;
}