Skip to content

Commit

Permalink
Fix issue with dropping texture in 2D viewport causing incorrect glob…
Browse files Browse the repository at this point in the history
…al history registration

This fix addresses an issue where dropping a texture onto the 2D viewport in a scene without a root node incorrectly registers the action in the global history. Subsequently undoing and redoing this action in another scene results in the newly created node replacing the root of the current scene.

Fixes #86826.
  • Loading branch information
alessandrofama committed Jan 7, 2024
1 parent c8c483c commit 4ea5c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/plugins/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5842,7 +5842,7 @@ void CanvasItemEditorViewport::_perform_drop_data() {
Vector<String> error_files;

EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Create Node"));
undo_redo->create_action_for_history(TTR("Create Node"), EditorNode::get_editor_data().get_current_edited_scene_history_id());

for (int i = 0; i < selected_files.size(); i++) {
String path = selected_files[i];
Expand Down

0 comments on commit 4ea5c1f

Please sign in to comment.