Fix axis snapping of CollisionPolygon2d's newly created vertex

(cherry picked from commit ba58491ca7)
This commit is contained in:
Grzegorz Puławski 2022-08-07 15:10:28 +02:00 committed by Rémi Verschelde
parent 8f426262c8
commit 1799189202

View file

@ -319,9 +319,9 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
return true; return true;
} else { } else {
Vector<Vector2> vertices2 = _get_polygon(insert.polygon); Vector<Vector2> vertices2 = _get_polygon(insert.polygon);
pre_move_edit = vertices2;
edited_point = PosVertex(insert.polygon, insert.vertex + 1, xform.affine_inverse().xform(insert.pos)); edited_point = PosVertex(insert.polygon, insert.vertex + 1, xform.affine_inverse().xform(insert.pos));
vertices2.insert(edited_point.vertex, edited_point.pos); vertices2.insert(edited_point.vertex, edited_point.pos);
pre_move_edit = vertices2;
selected_point = edited_point; selected_point = edited_point;
edge_point = PosVertex(); edge_point = PosVertex();