nodes: if an item is pasted without a folder, ensure it is added to a folder

This commit is contained in:
itsmattkc
2023-02-28 20:51:33 -08:00
parent 9824760ce1
commit 43e4e78378
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -1092,6 +1092,9 @@ QVector<Node*> NodeView::ProcessDroppingAttachedNodes(MultiUndoCommand *command,
// Add node to the same graph that the context is in
if (ai.node->parent() != select_context->parent()) {
add_command->add_child(new NodeAddCommand(select_context->parent(), ai.node));
if (ai.node->IsItem() && !ai.node->folder()) {
add_command->add_child(new FolderAddChild(select_context->parent()->root(), ai.node));
}
}
// Add node to the context