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

View File

@@ -66,12 +66,12 @@ void TextScroller::Update(float dt){
if ( timer == 0 )
{
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];
}
currentId++;
if ( currentId >= (strings.size()-1) )
if ( currentId >= strings.size())
currentId = 0;
mText = wordWrap( scrollerText.str(), (int) mWidth );
}