Merge pull request #13956 from poke1024/fix-poly2d-mode-change
Fixes Polygon2D wip mode closing when editing mode is changed
This commit is contained in:
commit
7885360f3f
1 changed files with 5 additions and 2 deletions
|
@ -167,7 +167,7 @@ void AbstractPolygon2DEditor::_menu_option(int p_option) {
|
||||||
} break;
|
} break;
|
||||||
case MODE_EDIT: {
|
case MODE_EDIT: {
|
||||||
|
|
||||||
wip_active = false;
|
_wip_close();
|
||||||
mode = MODE_EDIT;
|
mode = MODE_EDIT;
|
||||||
button_create->set_pressed(false);
|
button_create->set_pressed(false);
|
||||||
button_edit->set_pressed(true);
|
button_edit->set_pressed(true);
|
||||||
|
@ -175,7 +175,7 @@ void AbstractPolygon2DEditor::_menu_option(int p_option) {
|
||||||
} break;
|
} break;
|
||||||
case MODE_DELETE: {
|
case MODE_DELETE: {
|
||||||
|
|
||||||
wip_active = false;
|
_wip_close();
|
||||||
mode = MODE_DELETE;
|
mode = MODE_DELETE;
|
||||||
button_create->set_pressed(false);
|
button_create->set_pressed(false);
|
||||||
button_edit->set_pressed(false);
|
button_edit->set_pressed(false);
|
||||||
|
@ -224,6 +224,9 @@ void AbstractPolygon2DEditor::_wip_changed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractPolygon2DEditor::_wip_close() {
|
void AbstractPolygon2DEditor::_wip_close() {
|
||||||
|
if (!wip_active)
|
||||||
|
return;
|
||||||
|
|
||||||
if (_is_line()) {
|
if (_is_line()) {
|
||||||
|
|
||||||
_set_polygon(0, wip);
|
_set_polygon(0, wip);
|
||||||
|
|
Loading…
Reference in a new issue