From 1217d7d6780a323ade65efd0b31e42a877d871f0 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Thu, 21 Dec 2023 17:25:21 +0800 Subject: [PATCH] Fix `UndoRedo history mismatch` when creating a new tile atlas --- editor/plugins/tiles/tile_set_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index ef56e66e85..7242920368 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -117,11 +117,11 @@ void TileSetEditor::_load_texture_files(const Vector &p_paths) { // Actually create the new source. Ref atlas_source = memnew(TileSetAtlasSource); atlas_source->set_texture(texture); + atlas_source->set_texture_region_size(tile_set->get_tile_size()); EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); undo_redo->create_action(TTR("Add a new atlas source")); undo_redo->add_do_method(*tile_set, "add_source", atlas_source, source_id); - undo_redo->add_do_method(*atlas_source, "set_texture_region_size", tile_set->get_tile_size()); undo_redo->add_undo_method(*tile_set, "remove_source", source_id); undo_redo->commit_action();