diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-13 21:23:56 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-13 21:26:46 +0300 |
commit | 53ea46d36c30cc43f5241384d2ac614c7ed14b1f (patch) | |
tree | dc767581d0dc1ddacf401592f9c80a008198d8e2 /source/blender/editors/space_outliner | |
parent | 3a3587f4b265d6581c6b4be4edfcdeefb1897e8c (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 10 | ||||
-rw-r--r-- | source/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) { |