Fix missing highlights in 3D View

Things like selection outlines didn't work at all.

Caused by rBc973e8d2da5cf3f.
When splitting up bitflags, the equivalent to `foo->flag & (bar1 + bar2)` is
`(foo->flag1 & bar1) || (foo->flag2 & bar2)`, *not*
`(foo->flag1 & bar1) && (foo->flag2 & bar2)`.
Also, let's please avoid using '+' operator for bitwise operations, a
binary addition is a binary OR *with* cary, which can cause quite some damage.
This commit is contained in:
Julian Eisel 2017-02-09 21:16:06 +01:00
parent ca9c1de33e
commit 0ce76a4274
1 changed files with 4 additions and 5 deletions

View File

@ -8109,20 +8109,19 @@ void draw_object_wire_color(Scene *scene, SceneLayer *sl, Base *base, unsigned c
if ((scene->obedit == NULL) &&
(G.moving & G_TRANSFORM_OBJ) &&
(base->flag & BASE_SELECTED) &&
(base->flag_legacy & BA_WAS_SEL))
((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL)))
{
theme_id = TH_TRANSFORM;
}
else {
/* Sets the 'colindex' */
if (ID_IS_LINKED_DATABLOCK(ob)) {
colindex = ((base->flag & BASE_SELECTED) && (base->flag_legacy & BA_WAS_SEL)) ? 2 : 1;
colindex = ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL)) ? 2 : 1;
}
/* Sets the 'theme_id' or fallback to wire */
else {
if ((ob->flag & OB_FROMGROUP) != 0) {
if ((base->flag & BASE_SELECTED) && (base->flag_legacy & BA_WAS_SEL)) {
if ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL)) {
/* uses darker active color for non-active + selected */
theme_id = TH_GROUP_ACTIVE;
@ -8135,7 +8134,7 @@ void draw_object_wire_color(Scene *scene, SceneLayer *sl, Base *base, unsigned c
}
}
else {
if ((base->flag & BASE_SELECTED) && (base->flag_legacy & BA_WAS_SEL)) {
if ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL)) {
theme_id = sl->basact == base ? TH_ACTIVE : TH_SELECT;
}
else {