소스 검색

Merge pull request #14484 from Zylann/fix_mouse_focus_button_release

Fix mouse button release not sent to gui_input if it's different from the button that gave focus
Rémi Verschelde 7 년 전
부모
커밋
9079be9e83
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      scene/main/viewport.cpp

+ 2 - 1
scene/main/viewport.cpp

@@ -1811,7 +1811,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;
 			}