Skip to content

Commit

Permalink
Fix mouse button release not sent to gui_input if it's different from…
Browse files Browse the repository at this point in the history
… the button that gave focus
  • Loading branch information
Zylann committed Dec 10, 2017
1 parent 028f959 commit f52da15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f52da15

Please sign in to comment.