Allow mouse wheel to go throuhgh so scroll containers work properly, fixes #4431

(cherry picked from commit 85d8000449)
This commit is contained in:
Juan Linietsky 2016-06-20 17:16:52 -03:00 committed by Rémi Verschelde
parent b457b8ac89
commit ad01fa2248
1 changed files with 9 additions and 1 deletions

View File

@ -1481,6 +1481,14 @@ void Viewport::_gui_call_input(Control *p_control,const InputEvent& p_input) {
// _block(); // _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; CanvasItem *ci=p_control;
while(ci) { while(ci) {
@ -1496,7 +1504,7 @@ void Viewport::_gui_call_input(Control *p_control,const InputEvent& p_input) {
break; break;
if (gui.key_event_accepted) if (gui.key_event_accepted)
break; 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; break;
} }