Skip to content

Commit

Permalink
Merge pull request #30378 from Kanabenki/sort-selection-duplicate
Browse files Browse the repository at this point in the history
Sort selected nodes in scene tree before duplication
  • Loading branch information
akien-mga authored Jul 6, 2019
2 parents 9d6859c + 6eb6895 commit 3c133ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3c133ae

Please sign in to comment.