Fixed a bug in the text scroller that caused it to display only the first item.

This commit is contained in:
wrenczes@gmail.com
2010-11-07 13:03:36 +00:00
parent 471cbd6ba4
commit 7818277e3a
+2 -2
View File
@@ -66,12 +66,12 @@ void TextScroller::Update(float dt){
if ( timer == 0 ) if ( timer == 0 )
{ {
size_t nbItemsToDisplay = ( minimumItems < strings.size() ? minimumItems : strings.size()); size_t nbItemsToDisplay = ( minimumItems < strings.size() ? minimumItems : strings.size());
for ( size_t idx = 0; idx < nbItemsToDisplay; idx ++ ) for ( size_t idx = 0; idx < nbItemsToDisplay; ++idx)
{ {
scrollerText << strings[currentId + idx]; scrollerText << strings[currentId + idx];
} }
currentId++; currentId++;
if ( currentId >= (strings.size()-1) ) if ( currentId >= strings.size())
currentId = 0; currentId = 0;
mText = wordWrap( scrollerText.str(), (int) mWidth ); mText = wordWrap( scrollerText.str(), (int) mWidth );
} }