Fixes undo/redo in tileset polygon editor

This commit is contained in:
Gilles Roudière 2023-10-10 10:33:05 +02:00
parent 42425baa59
commit 8b608f3e6e

View file

@ -361,8 +361,8 @@ void GenericTilePolygonEditor::_advanced_menu_item_pressed(int p_item_pressed) {
}
undo_redo->add_do_method(base_control, "queue_redraw");
undo_redo->add_do_method(this, "emit_signal", "polygons_changed");
for (const PackedVector2Array &polygon : polygons) {
undo_redo->add_undo_method(this, "set_polygon", polygon);
for (unsigned int i = 0; i < polygons.size(); i++) {
undo_redo->add_undo_method(this, "set_polygon", i, polygons[i]);
}
undo_redo->add_undo_method(base_control, "queue_redraw");
undo_redo->add_undo_method(this, "emit_signal", "polygons_changed");