mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Fixed an issue where overlapping carousel items were not rendered correctly during transitions.
This commit is contained in:
parent
3789a0ca12
commit
87749e7d37
|
@ -113,6 +113,7 @@ private:
|
||||||
|
|
||||||
float mEntryCamOffset;
|
float mEntryCamOffset;
|
||||||
int mPreviousScrollVelocity;
|
int mPreviousScrollVelocity;
|
||||||
|
bool mPositiveDirection;
|
||||||
bool mTriggerJump;
|
bool mTriggerJump;
|
||||||
bool mGamelistView;
|
bool mGamelistView;
|
||||||
bool mUppercase;
|
bool mUppercase;
|
||||||
|
@ -157,6 +158,7 @@ CarouselComponent<T>::CarouselComponent()
|
||||||
, mRenderer {Renderer::getInstance()}
|
, mRenderer {Renderer::getInstance()}
|
||||||
, mEntryCamOffset {0.0f}
|
, mEntryCamOffset {0.0f}
|
||||||
, mPreviousScrollVelocity {0}
|
, mPreviousScrollVelocity {0}
|
||||||
|
, mPositiveDirection {false}
|
||||||
, mTriggerJump {false}
|
, mTriggerJump {false}
|
||||||
, mGamelistView {std::is_same_v<T, FileData*> ? true : false}
|
, mGamelistView {std::is_same_v<T, FileData*> ? true : false}
|
||||||
, mUppercase {false}
|
, mUppercase {false}
|
||||||
|
@ -621,7 +623,13 @@ template <typename T> void CarouselComponent<T>::render(const glm::mat4& parentT
|
||||||
yOff += mSize.y * mVerticalOffset;
|
yOff += mSize.y * mVerticalOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
int center {static_cast<int>(mEntryCamOffset)};
|
int center {0};
|
||||||
|
// Needed to make sure that overlapping items are renderered correctly.
|
||||||
|
if (mPositiveDirection)
|
||||||
|
center = static_cast<int>(std::floor(mEntryCamOffset));
|
||||||
|
else
|
||||||
|
center = static_cast<int>(std::ceil(mEntryCamOffset));
|
||||||
|
|
||||||
int itemInclusion {static_cast<int>(std::ceil(mMaxItemCount / 2.0f))};
|
int itemInclusion {static_cast<int>(std::ceil(mMaxItemCount / 2.0f))};
|
||||||
bool singleEntry {numEntries == 1};
|
bool singleEntry {numEntries == 1};
|
||||||
|
|
||||||
|
@ -1099,6 +1107,12 @@ template <typename T> void CarouselComponent<T>::onCursorChanged(const CursorSta
|
||||||
if (endPos == mEntryCamOffset)
|
if (endPos == mEntryCamOffset)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Needed to make sure that overlapping items are renderered correctly.
|
||||||
|
if (startPos > endPos)
|
||||||
|
mPositiveDirection = true;
|
||||||
|
else
|
||||||
|
mPositiveDirection = false;
|
||||||
|
|
||||||
Animation* anim {new LambdaAnimation(
|
Animation* anim {new LambdaAnimation(
|
||||||
[this, startPos, endPos, posMax](float t) {
|
[this, startPos, endPos, posMax](float t) {
|
||||||
t -= 1;
|
t -= 1;
|
||||||
|
|
Loading…
Reference in a new issue