Merge pull request #86387 from jsjtxietian/fix-tile-set
Fix `UndoRedo history mismatch` when creating a new tile atlas
This commit is contained in:
commit
980d55198c
1 changed files with 1 additions and 1 deletions
|
@ -117,11 +117,11 @@ void TileSetEditor::_load_texture_files(const Vector<String> &p_paths) {
|
||||||
// Actually create the new source.
|
// Actually create the new source.
|
||||||
Ref<TileSetAtlasSource> atlas_source = memnew(TileSetAtlasSource);
|
Ref<TileSetAtlasSource> atlas_source = memnew(TileSetAtlasSource);
|
||||||
atlas_source->set_texture(texture);
|
atlas_source->set_texture(texture);
|
||||||
|
atlas_source->set_texture_region_size(tile_set->get_tile_size());
|
||||||
|
|
||||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||||
undo_redo->create_action(TTR("Add a new atlas source"));
|
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(*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->add_undo_method(*tile_set, "remove_source", source_id);
|
||||||
undo_redo->commit_action();
|
undo_redo->commit_action();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue