mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-18 04:45:39 +00:00
Fixed an issue where the carousel would not update when entering and exiting gamelist folders.
This commit is contained in:
parent
30d4c587e7
commit
3636eeba18
|
@ -1123,30 +1123,28 @@ template <typename T> void CarouselComponent<T>::onCursorChanged(const CursorSta
|
||||||
if (mScrollVelocity != 0)
|
if (mScrollVelocity != 0)
|
||||||
mPreviousScrollVelocity = mScrollVelocity;
|
mPreviousScrollVelocity = mScrollVelocity;
|
||||||
|
|
||||||
// No need to animate transition, we're not going anywhere.
|
if (endPos != mEntryCamOffset) {
|
||||||
if (endPos == mEntryCamOffset)
|
// Needed to make sure that overlapping items are renderered correctly.
|
||||||
return;
|
if (startPos > endPos)
|
||||||
|
mPositiveDirection = true;
|
||||||
|
else
|
||||||
|
mPositiveDirection = false;
|
||||||
|
|
||||||
// Needed to make sure that overlapping items are renderered correctly.
|
Animation* anim {new LambdaAnimation(
|
||||||
if (startPos > endPos)
|
[this, startPos, endPos, posMax](float t) {
|
||||||
mPositiveDirection = true;
|
t -= 1;
|
||||||
else
|
float f {glm::mix(startPos, endPos, t * t * t + 1)};
|
||||||
mPositiveDirection = false;
|
if (f < 0)
|
||||||
|
f += posMax;
|
||||||
|
if (f >= posMax)
|
||||||
|
f -= posMax;
|
||||||
|
|
||||||
Animation* anim {new LambdaAnimation(
|
mEntryCamOffset = f;
|
||||||
[this, startPos, endPos, posMax](float t) {
|
},
|
||||||
t -= 1;
|
mTransitionsAnimTime)};
|
||||||
float f {glm::mix(startPos, endPos, t * t * t + 1)};
|
|
||||||
if (f < 0)
|
|
||||||
f += posMax;
|
|
||||||
if (f >= posMax)
|
|
||||||
f -= posMax;
|
|
||||||
|
|
||||||
mEntryCamOffset = f;
|
GuiComponent::setAnimation(anim, 0, nullptr, false, 0);
|
||||||
},
|
}
|
||||||
mTransitionsAnimTime)};
|
|
||||||
|
|
||||||
GuiComponent::setAnimation(anim, 0, nullptr, false, 0);
|
|
||||||
|
|
||||||
if (mCursorChangedCallback && !mEntries.empty())
|
if (mCursorChangedCallback && !mEntries.empty())
|
||||||
mCursorChangedCallback(state);
|
mCursorChangedCallback(state);
|
||||||
|
|
Loading…
Reference in a new issue