diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-23 10:08:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 10:08:48 +0200 |
commit | 335faa10f8c579ada6868cf0cafbd2e17b071c83 (patch) | |
tree | d0a4d073dcdedb8cc878aac4ddd5d5bdc70852a1 /editor | |
parent | 3f4e39e606b0bed539a3b8fb9b38aed4721c6262 (diff) | |
parent | 69d0d8921448acfa3c01f2d88bf6311f4ffef593 (diff) |
Merge pull request #39773 from mrushyendra/uv_editor
Enable finer grained control when creating polygon with UV Editor
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 1d273f74f0..633863041f 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -485,7 +485,8 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { } else { Vector2 tuv = mtx.affine_inverse().xform(snap_point(Vector2(mb->get_position().x, mb->get_position().y))); - if (points_prev.size() > 2 && tuv.distance_to(points_prev[0]) < 8) { + // Close the polygon if selected point is near start. Threshold for closing scaled by zoom level + if (points_prev.size() > 2 && tuv.distance_to(points_prev[0]) < (8 / uv_draw_zoom)) { undo_redo->create_action(TTR("Create Polygon & UV")); undo_redo->add_do_method(node, "set_uv", node->get_uv()); undo_redo->add_undo_method(node, "set_uv", uv_create_uv_prev); |