summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorEmmanuel Barroga <emmanuelbarroga@gmail.com>2019-08-04 16:09:57 -0700
committerEmmanuel Barroga <emmanuelbarroga@gmail.com>2019-08-04 16:09:57 -0700
commit6c83550dfca4e38a6bb87bf12ff950ca3ab8f285 (patch)
treed2b396e95cf2a3e31709a7167090e1b66e021f53 /editor/plugins
parent7126654eafc5a50a782bfbcdcfcb243807662eab (diff)
Fix Redundant Navigation Polygons
When adjusting the vertices of a navigation polygon, the tile editor would create a duplicate navigation polygon. So each time you made an adjustment, another copy of the polygon would be created.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index f135becf5f..952373675f 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -1519,6 +1519,8 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
undo_redo->create_action(TTR("Edit Navigation Polygon"));
undo_redo->add_do_method(edited_navigation_shape.ptr(), "set_vertices", polygon);
undo_redo->add_undo_method(edited_navigation_shape.ptr(), "set_vertices", edited_navigation_shape->get_vertices());
+ undo_redo->add_do_method(edited_navigation_shape.ptr(), "clear_polygons");
+ undo_redo->add_undo_method(edited_navigation_shape.ptr(), "clear_polygons");
undo_redo->add_do_method(edited_navigation_shape.ptr(), "add_polygon", indices);
undo_redo->add_undo_method(edited_navigation_shape.ptr(), "add_polygon", edited_navigation_shape->get_polygon(0));
undo_redo->add_do_method(this, "_select_edited_shape_coord");