Update focus mask only if there is a focused control, fixes #26524
This commit is contained in:
parent
9dd9737cb4
commit
03cafd4895
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue