[Bf-blender-cvs] [8a6f224e260] master: Fix logic error when trying to find hovered item

Julian Eisel noreply at git.blender.org
Wed Oct 6 16:56:02 CEST 2021


Commit: 8a6f224e260b2ec7e39d2a02fca62f9614049091
Author: Julian Eisel
Date:   Wed Oct 6 16:52:16 2021 +0200
Branches: master
https://developer.blender.org/rB8a6f224e260b2ec7e39d2a02fca62f9614049091

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.

===================================================================

M	source/blender/editors/interface/tree_view.cc

===================================================================

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;



More information about the Bf-blender-cvs mailing list