Commit b8d55b24 by Maganty Rushyendra

Fix accidental duplication of Polygon2D start point

Ensures that closure of Polygon2D in the editor takes into account Grid Snap if enabled. Does this by comparing the polygon start with grid snap applied to mouse click location. Note: transformation is applied in order to deal with different editor zoom levels.
parent 75c91707
......@@ -369,7 +369,7 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
} else {
const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
if (!_is_line() && wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_threshold) {
if (!_is_line() && wip.size() > 1 && xform.xform(wip[0]).distance_to(xform.xform(cpoint)) < grab_threshold) {
//wip closed
_wip_close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment