From 53ea46d36c30cc43f5241384d2ac614c7ed14b1f Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 13 Dec 2017 16:23:56 -0200 Subject: [PATCH] Outliner: Fix selection drawing Outliner was using the old selection flag to show selected objects. So if you selected an object in the outliner it would keep "selected" (drawn in yellow) even after you selected another object. --- source/blender/editors/space_outliner/outliner_draw.c | 10 ++++++---- .../blender/editors/space_outliner/outliner_select.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 670fc4e6627..cecfc0cb71d 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1378,22 +1378,24 @@ static void outliner_draw_tree_element( } else if (te->idcode == ID_OB) { Object *ob = (Object *)tselem->id; - - if (ob == OBACT(view_layer) || (ob->flag & SELECT)) { + Base *base = (Base *)te->directdata; + const bool is_selected = (base != NULL) && ((base->flag & BASE_SELECTED) != 0); + + if (ob == OBACT(view_layer) || is_selected) { char col[4] = {0, 0, 0, 0}; /* outliner active ob: always white text, circle color now similar to view3d */ active = OL_DRAWSEL_ACTIVE; if (ob == OBACT(view_layer)) { - if (ob->flag & SELECT) { + if (is_selected) { UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col); col[3] = alpha; } active = OL_DRAWSEL_NORMAL; } - else if (ob->flag & SELECT) { + else if (is_selected) { UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col); col[3] = alpha; } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 1806d52f1b3..fcbb0986e09 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -185,7 +185,7 @@ static eOLDrawState tree_element_set_active_object( if (recursive) { /* Recursive select/deselect for Object hierarchies */ - do_outliner_object_select_recursive(view_layer, ob, (ob->flag & SELECT) != 0); + do_outliner_object_select_recursive(view_layer, ob, (base->flag & BASE_SELECTED) != 0); } if (set != OL_SETSEL_NONE) {