Fixed an issue where the imageSelectedColor and textSelectedColor carousel properties would color shift too many items.

This commit is contained in:
Leon Styhre 2023-02-15 19:19:16 +01:00
parent ace3ace916
commit 1939080e82

View file

@ -1123,7 +1123,8 @@ template <typename T> void CarouselComponent<T>::render(const glm::mat4& parentT
comp->setScale(renderItem.scale); comp->setScale(renderItem.scale);
comp->setOpacity(renderItem.opacity * metadataOpacity); comp->setOpacity(renderItem.opacity * metadataOpacity);
if (renderItem.index == mCursor && (mHasImageSelectedColor || mHasTextSelectedColor)) { if (renderItem.index == mCursor && std::abs(renderItem.distance) < 1.0f &&
(mHasImageSelectedColor || mHasTextSelectedColor)) {
if (mHasTextSelectedColor && mEntries.at(renderItem.index).data.imagePath == "" && if (mHasTextSelectedColor && mEntries.at(renderItem.index).data.imagePath == "" &&
mEntries.at(renderItem.index).data.defaultImagePath == "") { mEntries.at(renderItem.index).data.defaultImagePath == "") {
comp->setColor(mTextSelectedColor); comp->setColor(mTextSelectedColor);