From d1a35b7a085ac299feafef7c785c9c7565da20f4 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Sun, 16 Oct 2016 21:41:10 +0200 Subject: 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". --- source/blender/editors/space_outliner/outliner_select.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '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 101ad235428..a9f834c509f 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); } -- cgit v1.2.3