Fix UndoRedo history mismatch
when creating a new tile atlas
This commit is contained in:
parent
3ce73e5d41
commit
1217d7d678
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.
|
||||
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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue