Merge pull request #32672 from codecustard/fix_merge_scene_not_deselecting
Fixes deselection not working when merging scene
This commit is contained in:
commit
564a258831
1 changed files with 13 additions and 2 deletions
|
@ -97,8 +97,14 @@ void EditorSubScene::_fill_tree(Node *p_node, TreeItem *p_parent) {
|
|||
}
|
||||
|
||||
void EditorSubScene::_selected_changed() {
|
||||
selection.clear();
|
||||
is_root = false;
|
||||
TreeItem *item = tree->get_selected();
|
||||
ERR_FAIL_COND(!item);
|
||||
Node *n = item->get_metadata(0);
|
||||
|
||||
if (!n || !selection.find(n)) {
|
||||
selection.clear();
|
||||
is_root = false;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorSubScene::_item_multi_selected(Object *p_object, int p_cell, bool p_selected) {
|
||||
|
@ -116,6 +122,11 @@ void EditorSubScene::_item_multi_selected(Object *p_object, int p_cell, bool p_s
|
|||
selection.clear();
|
||||
}
|
||||
selection.push_back(n);
|
||||
} else {
|
||||
List<Node *>::Element *E = selection.find(n);
|
||||
|
||||
if (E)
|
||||
selection.erase(E);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue