Commit 03cafd48 by Juan Linietsky

Update focus mask only if there is a focused control, fixes #26524

parent 9dd9737c
...@@ -1783,13 +1783,15 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { ...@@ -1783,13 +1783,15 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
*/ */
gui.mouse_focus = _gui_find_control(pos); gui.mouse_focus = _gui_find_control(pos);
gui.mouse_focus_mask = 1 << (mb->get_button_index() - 1);
gui.last_mouse_focus = gui.mouse_focus; gui.last_mouse_focus = gui.mouse_focus;
if (!gui.mouse_focus) { if (!gui.mouse_focus) {
gui.mouse_focus_mask = 0;
return; return;
} }
gui.mouse_focus_mask = 1 << (mb->get_button_index() - 1);
if (mb->get_button_index() == BUTTON_LEFT) { if (mb->get_button_index() == BUTTON_LEFT) {
gui.drag_accum = Vector2(); gui.drag_accum = Vector2();
gui.drag_attempted = false; gui.drag_attempted = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment