diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index 7e44526..99dbf3e 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -36,7 +36,7 @@ #include #include #include - +#include //todo: remove coupling from configuration data (if possible) ScrollingList::ScrollingList(Configuration &c, @@ -246,10 +246,10 @@ void ScrollingList::click(double nextScrollTime) } else if(currentScrollDirection_ == ScrollDirectionForward) { + unsigned int itemIncrement = loopIncrement(itemIndex_, scrollPoints_->size(), items_->size()); itemIndex_ = loopIncrement(itemIndex_, 1, items_->size()); - Item *i = items_->at(itemIndex_); + Item *i = items_->at(itemIncrement); - deallocateTexture(componentIndex_); allocateTexture(componentIndex_, i);