mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed an issue where text elements that had an opacity set to lower than FF via the color tag were faded in during gamelist scrolling.
This commit is contained in:
parent
92d1cf2fd3
commit
93e0bfab5b
|
@ -626,10 +626,9 @@ void GamelistView::legacyUpdateInfoPanel(const CursorState& state)
|
|||
|
||||
for (auto it = comps.cbegin(); it != comps.cend(); ++it) {
|
||||
GuiComponent* comp {*it};
|
||||
// An animation is playing, then animate if reverse != fadingOut.
|
||||
// An animation is not playing, then animate if opacity != our target opacity.
|
||||
if ((comp->isAnimationPlaying(0) && comp->isAnimationReversed(0) != fadingOut) ||
|
||||
(!comp->isAnimationPlaying(0) && comp->getOpacity() != (fadingOut ? 0.0f : 1.0f))) {
|
||||
(!comp->isAnimationPlaying(0) &&
|
||||
comp->getOpacity() != (fadingOut ? 0.0f : comp->getColorOpacity()))) {
|
||||
auto func = [comp](float t) { comp->setOpacity(glm::mix(0.0f, 1.0f, t)); };
|
||||
comp->setAnimation(new LambdaAnimation(func, 150), 0, nullptr, fadingOut);
|
||||
}
|
||||
|
|
|
@ -781,10 +781,9 @@ void GamelistView::updateInfoPanel(const CursorState& state)
|
|||
|
||||
for (auto it = comps.cbegin(); it != comps.cend(); ++it) {
|
||||
GuiComponent* comp {*it};
|
||||
// An animation is playing, then animate if reverse != fadingOut.
|
||||
// An animation is not playing, then animate if opacity != our target opacity.
|
||||
if ((comp->isAnimationPlaying(0) && comp->isAnimationReversed(0) != fadingOut) ||
|
||||
(!comp->isAnimationPlaying(0) && comp->getOpacity() != (fadingOut ? 0.0f : 1.0f))) {
|
||||
(!comp->isAnimationPlaying(0) &&
|
||||
comp->getOpacity() != (fadingOut ? 0.0f : comp->getColorOpacity()))) {
|
||||
auto func = [comp](float t) { comp->setOpacity(glm::mix(0.0f, 1.0f, t)); };
|
||||
comp->setAnimation(new LambdaAnimation(func, 150), 0, nullptr, fadingOut);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ public:
|
|||
virtual bool isListScrolling() { return false; }
|
||||
virtual void stopListScrolling() {}
|
||||
virtual const float getOpacity() const { return mOpacity; }
|
||||
virtual const float getColorOpacity() const { return 1.0f; }
|
||||
virtual void setOpacity(float opacity);
|
||||
virtual float getSaturation() const { return static_cast<float>(mColor); }
|
||||
virtual void setSaturation(float saturation) { mSaturation = saturation; }
|
||||
|
|
|
@ -61,6 +61,8 @@ public:
|
|||
{
|
||||
return static_cast<float>((mColor & 0x000000FF) / 255.0f);
|
||||
}
|
||||
float const getColorOpacity() const override { return mColorOpacity; }
|
||||
|
||||
void setOpacity(float opacity) override;
|
||||
void setDimming(float dimming) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue