From 06eef4c64d721d9bdd645e386b800d2b07e1d6c1 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 7 Jun 2023 23:27:11 +0200 Subject: [PATCH] Fix nodes selectable abnormally when using filter --- editor/gui/scene_tree_editor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index 5b9f2c3b21c..76e09769cc5 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -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);