summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMai Lavelle <mai.lavelle@gmail.com>2023-01-17 18:43:16 -0500
committerMai Lavelle <mai.lavelle@gmail.com>2023-01-17 19:12:55 -0500
commita058cedb532942d5c08ac48f30645478bed8565b (patch)
treeff8e578d72993c4a90739d18130284be40e10214
parent0ddd9c3e8f9088fa139e25b2903289d727073e12 (diff)
Fix crash on touch release
-rw-r--r--scene/main/viewport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index ef58386b45..9efe649e6f 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1901,7 +1901,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
Control *over = control_id.is_valid() ? Object::cast_to<Control>(ObjectDB::get_instance(control_id)) : nullptr;
if (over && over->can_process()) {
touch_event = touch_event->xformed_by(Transform2D()); // Make a copy.
- pos = gui.last_mouse_focus->get_global_transform_with_canvas().affine_inverse().xform(pos);
+ pos = over->get_global_transform_with_canvas().affine_inverse().xform(pos);
touch_event->set_position(pos);
stopped = _gui_call_input(over, touch_event);