Ported: Set touch input as handled only after _gui_call_input - necrashter

147de75e52
This commit is contained in:
Relintai 2023-01-16 14:46:29 +01:00
parent 5579d563bd
commit 8c9d7bc567

View File

@ -2234,15 +2234,15 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
}
touch_event->set_position(pos);
_gui_call_input(over, touch_event);
set_input_as_handled();
}
set_input_as_handled();
return;
}
} else {
ObjectID control_id = gui.touch_focus[touch_index];
Control *over = Object::cast_to<Control>(ObjectDB::get_instance(control_id));
if (over && over->can_process()) {
touch_event = touch_event->xformed_by(Transform2D()); //make a copy
if (over == gui.last_mouse_focus) {
@ -2254,9 +2254,10 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
_gui_call_input(over, touch_event);
set_input_as_handled();
gui.touch_focus.erase(touch_index);
return;
}
gui.touch_focus.erase(touch_index);
return;
}
}