Scrolling now works. ReloadableImages are not always updating properly from component states.

This commit is contained in:
emb 2015-08-05 10:44:27 -05:00
parent 9330e85f31
commit c20ac31fea

View File

@ -36,7 +36,7 @@
#include <SDL2/SDL_image.h> #include <SDL2/SDL_image.h>
#include <sstream> #include <sstream>
#include <cctype> #include <cctype>
#include <iomanip>
//todo: remove coupling from configuration data (if possible) //todo: remove coupling from configuration data (if possible)
ScrollingList::ScrollingList(Configuration &c, ScrollingList::ScrollingList(Configuration &c,
@ -246,9 +246,9 @@ void ScrollingList::click(double nextScrollTime)
} }
else if(currentScrollDirection_ == ScrollDirectionForward) else if(currentScrollDirection_ == ScrollDirectionForward)
{ {
unsigned int itemIncrement = loopIncrement(itemIndex_, scrollPoints_->size(), items_->size());
itemIndex_ = loopIncrement(itemIndex_, 1, items_->size()); itemIndex_ = loopIncrement(itemIndex_, 1, items_->size());
Item *i = items_->at(itemIndex_); Item *i = items_->at(itemIncrement);
deallocateTexture(componentIndex_); deallocateTexture(componentIndex_);
allocateTexture(componentIndex_, i); allocateTexture(componentIndex_, i);