diff --git a/es-core/src/components/ScrollableContainer.cpp b/es-core/src/components/ScrollableContainer.cpp index d7462c4a5..d299ce680 100644 --- a/es-core/src/components/ScrollableContainer.cpp +++ b/es-core/src/components/ScrollableContainer.cpp @@ -165,8 +165,14 @@ void ScrollableContainer::update(int deltaTime) mAutoScrollResetAccumulator += deltaTime; if (mAutoScrollResetAccumulator >= static_cast(mAutoScrollResetDelayConstant)) { // Fade in the text as it resets to the start position. - auto func = [this](float t) { - this->setOpacity(static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + float maxOpacity {static_cast(mChildren.front()->getColor() & 0x000000FF) / + 255.0f}; + auto func = [this, maxOpacity](float t) { + unsigned int color {mChildren.front()->getColor()}; + unsigned int opacity { + static_cast(glm::mix(0.0f, maxOpacity, t) * 255)}; + color = (color & 0xFFFFFF00) + opacity; + this->mChildren.front()->setColor(color); mScrollPos = glm::vec2 {}; mAutoScrollResetAccumulator = 0; mAutoScrollAccumulator = -mAutoScrollDelay + mAutoScrollSpeed;