diff options
author | Julian Eisel <julian@blender.org> | 2021-10-06 17:52:16 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-06 17:55:51 +0300 |
commit | 8a6f224e260b2ec7e39d2a02fca62f9614049091 (patch) | |
tree | e3923fe2bc28ac211f1b7537da42c5716e7e9f97 | |
parent | bbfa6a92cf1c7581a09712401f50c0f0fc02240d (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.cc | 3 |
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; |