diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-12-07 00:29:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-07 00:29:12 +0100 |
commit | 7885360f3f19994b29483c19a667b76e20ca7a7a (patch) | |
tree | 750f7d80952d6caae3172be973fe25be7fb463b3 | |
parent | c0fd111e71bf12df346793a71229cb6d983c09bd (diff) | |
parent | ca7e9c034882aa409d04c6921572e1845ba8bf0f (diff) |
Merge pull request #13956 from poke1024/fix-poly2d-mode-change
Fixes Polygon2D wip mode closing when editing mode is changed
-rw-r--r-- | editor/plugins/abstract_polygon_2d_editor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index cabdfa761d..95ae3d5aed 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -167,7 +167,7 @@ void AbstractPolygon2DEditor::_menu_option(int p_option) { } break; case MODE_EDIT: { - wip_active = false; + _wip_close(); mode = MODE_EDIT; button_create->set_pressed(false); button_edit->set_pressed(true); @@ -175,7 +175,7 @@ void AbstractPolygon2DEditor::_menu_option(int p_option) { } break; case MODE_DELETE: { - wip_active = false; + _wip_close(); mode = MODE_DELETE; button_create->set_pressed(false); button_edit->set_pressed(false); @@ -224,6 +224,9 @@ void AbstractPolygon2DEditor::_wip_changed() { } void AbstractPolygon2DEditor::_wip_close() { + if (!wip_active) + return; + if (_is_line()) { _set_polygon(0, wip); |