Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-10-06 17:52:16 +0300
committerJulian Eisel <julian@blender.org>2021-10-06 17:55:51 +0300
commit8a6f224e260b2ec7e39d2a02fca62f9614049091 (patch)
treee3923fe2bc28ac211f1b7537da42c5716e7e9f97
parentbbfa6a92cf1c7581a09712401f50c0f0fc02240d (diff)
Fix logic error when trying to find hovered item
Was just comparing this item's and the parent item's names. But if an item has no parents, only its own name has to match for the check to return true. Make sure that the number of parents also matches.
-rw-r--r--source/blender/editors/interface/tree_view.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/tree_view.cc b/source/blender/editors/interface/tree_view.cc
index 7bcf679a5ea..f3070481da2 100644
--- a/source/blender/editors/interface/tree_view.cc
+++ b/source/blender/editors/interface/tree_view.cc
@@ -439,6 +439,9 @@ bool AbstractTreeViewItem::matches_including_parents(const AbstractTreeViewItem
if (!matches(other)) {
return false;
}
+ if (count_parents() != other.count_parents()) {
+ return false;
+ }
for (AbstractTreeViewItem *parent = parent_, *other_parent = other.parent_;
parent && other_parent;