From 809858107975607c8281a2c6ffff51ba191d6516 Mon Sep 17 00:00:00 2001 From: Nikita Samusev Date: Tue, 24 Jun 2025 15:11:13 +0300 Subject: [PATCH] Fix points jumping when dragging starts in the Polygon2D editor --- editor/plugins/polygon_2d_editor_plugin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 0e612f1c12e..95e24285d50 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -629,9 +629,8 @@ void Polygon2DEditor::_canvas_input(const Ref &p_input) { if (current_action == ACTION_EDIT_POINT) { point_drag_index = -1; for (int i = 0; i < editing_points.size(); i++) { - Vector2 tuv = mtx.xform(editing_points[i]); - if (tuv.distance_to(mb->get_position()) < 8) { - drag_from = tuv; + if (mtx.xform(editing_points[i]).distance_to(mb->get_position()) < 8) { + drag_from = mb->get_position(); point_drag_index = i; } }