Merge pull request #77982 from KoBeWi/fix_for_filter_failure

Fix nodes selectable abnormally when using filter
This commit is contained in:
Rémi Verschelde 2023-06-13 13:52:54 +02:00
commit b203651ad7
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -643,6 +643,19 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select
bool keep = _item_matches_all_terms(p_parent, terms);
p_parent->set_visible(keep_for_children || keep);
if (keep && !valid_types.is_empty()) {
keep = false;
Node *n = get_node(p_parent->get_metadata(0));
for (const StringName &E : valid_types) {
if (n->is_class(E) ||
EditorNode::get_singleton()->is_object_of_custom_type(n, E)) {
keep = true;
break;
}
}
}
if (keep_for_children) {
if (keep) {
p_parent->clear_custom_color(0);