[Bf-blender-cvs] [5129e2e042a] master: Fix T81675: Renaming collapsed collection in Outliner renames nested items

Julian Eisel noreply at git.blender.org
Thu Oct 15 20:34:24 CEST 2020


Commit: 5129e2e042a057a28ea75e4342a664277c74ca34
Author: Julian Eisel
Date:   Thu Oct 15 20:00:18 2020 +0200
Branches: master
https://developer.blender.org/rB5129e2e042a057a28ea75e4342a664277c74ca34

Fix T81675: Renaming collapsed collection in Outliner renames nested items

* `do_outliner_item_rename()` enables the rename mode for the item under the
  cursor. Issue is, collapsed children end up having stored the same coordinate
  as their parent, so they too would get the rename mode enabled (there is no
  early-exit that would hide this).
* The items displayed as inline icons do get the proper coordinates of the
  icons, so they are not mistaken as being under the cursor.

After rBb077de086e14, the Outliner tree is rebuilt less often, so the
coordinates are cleared less often too.

As far as I can see we can always clear coordinates of invisible items now. No
code seems to depend on keeping the old coordinates anymore.

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

M	source/blender/editors/space_outliner/outliner_draw.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 22bc0119652..09ccb950c18 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2915,9 +2915,9 @@ static void outliner_set_coord_tree_element(TreeElement *te, int startx, int sta
 
   /* closed items may be displayed in row of parent, don't change their coordinate! */
   if ((te->flag & TE_ICONROW) == 0 && (te->flag & TE_ICONROW_MERGED) == 0) {
-    /* store coord and continue, we need coordinates for elements outside view too */
-    te->xs = startx;
-    te->ys = starty;
+    te->xs = 0;
+    te->ys = 0;
+    te->xend = 0;
   }
 
   for (ten = te->subtree.first; ten; ten = ten->next) {



More information about the Bf-blender-cvs mailing list