Fix mouse button release not sent to gui_input if it's different from the button that gave focus

This commit is contained in:
Marc Gilleron 2017-12-10 02:25:39 +01:00
parent 028f959fb1
commit f52da158d9

View file

@ -1800,7 +1800,8 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
_gui_call_input(gui.mouse_focus, mb);
}
if (mb->get_button_index() == gui.mouse_focus_button) {
if (mb->get_button_mask() == 0) {
// Last mouse button was released
gui.mouse_focus = NULL;
gui.mouse_focus_button = -1;
}