Commit: d1a35b7a085ac299feafef7c785c9c7565da20f4
Author: Julian Eisel
Date:   Sun Oct 16 21:41:10 2016 +0200
Branches: blender2.8
https://developer.blender.org/rBd1a35b7a085ac299feafef7c785c9c7565da20f4

Fix outliner items sometimes not opening

Own mistake in 9a9a663f40d55. Guessed there is a case where we have to rebuild 
the tree but everything seemed fine... It didn't work in display modes like 
"Data-Blocks".

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_select.c 
b/source/blender/editors/space_outliner/outliner_select.c
index 101ad23..a9f834c 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -934,7 +934,7 @@ int outliner_item_activate_or_toggle_closed(bContext *C, 
int x, int y, bool exte
        SpaceOops *soops = CTX_wm_space_outliner(C);
        TreeElement *te;
        float view_mval[2];
-       bool changed = false;
+       bool changed = false, rebuild_tree = false;
 
        UI_view2d_region_to_view(&ar->v2d, x, y, &view_mval[0], &view_mval[1]);
 
@@ -948,6 +948,7 @@ int outliner_item_activate_or_toggle_closed(bContext *C, 
int x, int y, bool exte
        else if (outliner_item_is_co_within_close_toggle(te, view_mval[0])) {
                outliner_item_toggle_closed(te, extend);
                changed = true;
+               rebuild_tree = true;
        }
        else {
                /* the row may also contain children, if one is hovered we want 
this instead of current te */
@@ -959,7 +960,10 @@ int outliner_item_activate_or_toggle_closed(bContext *C, 
int x, int y, bool exte
        }
 
        if (changed) {
-               soops->storeflag |= SO_TREESTORE_REDRAW; /* only needs to 
redraw, no rebuild */
+               if (!rebuild_tree) {
+                       /* only needs to redraw, no rebuild */
+                       soops->storeflag |= SO_TREESTORE_REDRAW;
+               }
                ED_undo_push(C, "Outliner selection change");
                ED_region_tag_redraw(ar);
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to