mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-03 09:29:38 +01:00
Ported: Set touch input as handled only after _gui_call_input - necrashter
147de75e52
This commit is contained in:
parent
5579d563bd
commit
8c9d7bc567
@ -2234,15 +2234,15 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
|||||||
}
|
}
|
||||||
touch_event->set_position(pos);
|
touch_event->set_position(pos);
|
||||||
_gui_call_input(over, touch_event);
|
_gui_call_input(over, touch_event);
|
||||||
|
set_input_as_handled();
|
||||||
}
|
}
|
||||||
|
|
||||||
set_input_as_handled();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ObjectID control_id = gui.touch_focus[touch_index];
|
ObjectID control_id = gui.touch_focus[touch_index];
|
||||||
Control *over = Object::cast_to<Control>(ObjectDB::get_instance(control_id));
|
Control *over = Object::cast_to<Control>(ObjectDB::get_instance(control_id));
|
||||||
|
|
||||||
if (over && over->can_process()) {
|
if (over && over->can_process()) {
|
||||||
touch_event = touch_event->xformed_by(Transform2D()); //make a copy
|
touch_event = touch_event->xformed_by(Transform2D()); //make a copy
|
||||||
if (over == gui.last_mouse_focus) {
|
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);
|
_gui_call_input(over, touch_event);
|
||||||
set_input_as_handled();
|
set_input_as_handled();
|
||||||
gui.touch_focus.erase(touch_index);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gui.touch_focus.erase(touch_index);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user