Browse Source

Merge pull request #86387 from jsjtxietian/fix-tile-set

Fix `UndoRedo history mismatch` when creating a new tile atlas
Yuri Sizov 1 năm trước cách đây
mục cha
commit
980d55198c
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      editor/plugins/tiles/tile_set_editor.cpp

+ 1 - 1
editor/plugins/tiles/tile_set_editor.cpp

@@ -117,11 +117,11 @@ void TileSetEditor::_load_texture_files(const Vector<String> &p_paths) {
 		// Actually create the new source.
 		Ref<TileSetAtlasSource> 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();