diff options
author | Nodragem <geoffrey.megardon@outlook.com> | 2024-05-12 14:00:08 +0100 |
---|---|---|
committer | Nodragem <geoffrey.megardon@gmail.com> | 2024-05-16 10:42:13 +0100 |
commit | 8e0f0c6edbf8ca7457a4c2d562e1d43f18121b88 (patch) | |
tree | b35e53622704a11f07815666caa16b2d57944d98 /editor/plugins/node_3d_editor_plugin.cpp | |
parent | bdc0316217940a8ccc80ce536547d42e6477adf4 (diff) | |
download | redot-engine-8e0f0c6edbf8ca7457a4c2d562e1d43f18121b88.tar.gz |
change default behaviour when drag-and-drop to 2d and 3d editor
correct formatting with clang-formatter
US English
Diffstat (limited to 'editor/plugins/node_3d_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index b50c16c25f..9385b575a0 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4593,11 +4593,12 @@ void Node3DEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p_ Node *root_node = EditorNode::get_singleton()->get_edited_scene(); if (selected_nodes.size() > 0) { Node *selected_node = selected_nodes.front()->get(); - target_node = selected_node; if (is_alt) { target_node = root_node; - } else if (is_shift && selected_node != root_node) { - target_node = selected_node->get_parent(); + } else if (is_shift) { + target_node = selected_node; + } else { // Default behavior. + target_node = (selected_node != root_node) ? selected_node->get_parent() : root_node; } } else { if (root_node) { |