Merge pull request #83093 from groud/fix_polygon_editor_undo_redo

Fixes undo/redo in tileset polygon editor
This commit is contained in:
Rémi Verschelde 2023-10-10 12:34:46 +02:00
commit d80ce0c52a
No known key found for this signature in database
GPG key ID: C3336907360768E1

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");