diff options
author | Maganty Rushyendra <mrushyendra@yahoo.com.sg> | 2020-06-25 18:28:44 +0800 |
---|---|---|
committer | Maganty Rushyendra <mrushyendra@yahoo.com.sg> | 2020-06-25 18:42:18 +0800 |
commit | b8d55b244a21112c454e01d7758f30ff1af3860c (patch) | |
tree | 932d97004c166b3d33444d897e950dfeee63fd37 /editor | |
parent | 75c91707a4a8b3844746c3cf21a8a767c16da79d (diff) |
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.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/abstract_polygon_2d_editor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index e99ffe2b83..49e67f3605 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -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(); |