Bläddra i källkod

Fix points jumping when dragging starts in the Polygon2D editor

Nikita Samusev 2 månader sedan
förälder
incheckning
8098581079
1 ändrade filer med 2 tillägg och 3 borttagningar
  1. 2 3
      editor/plugins/polygon_2d_editor_plugin.cpp

+ 2 - 3
editor/plugins/polygon_2d_editor_plugin.cpp

@@ -629,9 +629,8 @@ void Polygon2DEditor::_canvas_input(const Ref<InputEvent> &p_input) {
 				if (current_action == ACTION_EDIT_POINT) {
 				if (current_action == ACTION_EDIT_POINT) {
 					point_drag_index = -1;
 					point_drag_index = -1;
 					for (int i = 0; i < editing_points.size(); i++) {
 					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;
 							point_drag_index = i;
 						}
 						}
 					}
 					}