diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-06 20:31:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-06 20:31:52 +0200 |
commit | 3c133aebdafd5002a7b8d4494be19d76977c3bc1 (patch) | |
tree | 24c7e2b8753d612a62b2dfd178cea2370d3ec122 /editor/scene_tree_dock.cpp | |
parent | 9d6859ca09d887246a7f3e653bed4c4b10fea3a7 (diff) | |
parent | 6eb6895db8a58ddffdccb4cc4ff65796cc0b53c0 (diff) |
Merge pull request #30378 from Kanabenki/sort-selection-duplicate
Sort selected nodes in scene tree before duplication
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r-- | editor/scene_tree_dock.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 5f62ed0702..935946bf24 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -569,7 +569,9 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { Node *dupsingle = NULL; List<Node *> editable_children; - for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { + selection.sort_custom<Node::Comparator>(); + + for (List<Node *>::Element *E = selection.back(); E; E = E->prev()) { Node *node = E->get(); Node *parent = node->get_parent(); |