From 721e51ac28f78c3553418651c205d6b3ac67bfde Mon Sep 17 00:00:00 2001 From: Uxeron Date: Fri, 18 Nov 2022 19:10:57 +0200 Subject: Fixed _get_drag_data getting incorrect position on scaled controls --- scene/main/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/main') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 4c2a761138..9e440405af 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1623,7 +1623,7 @@ void Viewport::_gui_input_event(Ref p_event) { Control *control = Object::cast_to(ci); if (control) { gui.dragging = true; - gui.drag_data = control->get_drag_data(control->get_global_transform_with_canvas().affine_inverse().xform(mpos) - gui.drag_accum); + gui.drag_data = control->get_drag_data(control->get_global_transform_with_canvas().affine_inverse().xform(mpos - gui.drag_accum)); if (gui.drag_data.get_type() != Variant::NIL) { gui.mouse_focus = nullptr; gui.forced_mouse_focus = false; -- cgit v1.2.3