Skip to content

Commit

Permalink
libcommon|Menu: Fix focused menu widget alpha blending during fade out
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Sep 26, 2014
1 parent 1cc6b4a commit 2da011e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion doomsday/plugins/common/src/menu/widgets/buttonwidget.cpp
Expand Up @@ -63,7 +63,8 @@ void ButtonWidget::draw() const
t = (1 + sin(page().timer() / (float)TICSPERSEC * speed * DD_PI)) / 2;
}

Vector4f const color = de::lerp(textColor, Vector4f(Vector3f(cfg.menuTextFlashColor), 1), t);
Vector4f const color = de::lerp(textColor, Vector4f(Vector3f(cfg.menuTextFlashColor), textColor.w), t);

FR_SetFont(fontId);
FR_SetColorAndAlpha(color.x, color.y, color.z, color.w);
DGL_Color4f(1, 1, 1, color.w);
Expand Down
3 changes: 2 additions & 1 deletion doomsday/plugins/common/src/menu/widgets/labelwidget.cpp
Expand Up @@ -63,7 +63,8 @@ void LabelWidget::draw() const
t = (1 + sin(page().timer() / (float)TICSPERSEC * speed * DD_PI)) / 2;
}

Vector4f const color = de::lerp(textColor, Vector4f(Vector3f(cfg.menuTextFlashColor), 1), t);
Vector4f const color = de::lerp(textColor, Vector4f(Vector3f(cfg.menuTextFlashColor), textColor.w), t);

DGL_Color4f(1, 1, 1, color.w);
FR_SetFont(fontId);
FR_SetColorAndAlpha(color.x, color.y, color.z, color.w);
Expand Down
6 changes: 2 additions & 4 deletions doomsday/plugins/common/src/menu/widgets/listwidget.cpp
Expand Up @@ -130,10 +130,8 @@ void ListWidget::draw() const
t = (1 + sin(page().timer() / (float)TICSPERSEC * speed * DD_PI)) / 2;
}

Vector4f const flashColor = de::lerp(textColor, Vector4f(Vector3f(cfg.menuTextFlashColor), 1), t);

Vector4f dimColor = textColor * MNDATA_LIST_NONSELECTION_LIGHT;
dimColor.w = textColor.w;
Vector4f const flashColor = de::lerp(textColor, Vector4f(Vector3f(cfg.menuTextFlashColor), textColor.w), t);
Vector4f const dimColor = Vector4f(Vector3f(textColor) * MNDATA_LIST_NONSELECTION_LIGHT, textColor.w);

if(d->first < d->items.count() && d->numvis > 0)
{
Expand Down

0 comments on commit 2da011e

Please sign in to comment.