Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7756 in orxonox.OLD for trunk/src/lib/graphics/text_engine


Ignore:
Timestamp:
May 21, 2006, 6:42:09 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Multiple Event Subscription Method
@patrick, do you approve of this, or do you think, that it is too much??

This is something i proposed some time ago, and it is nice, because one can overload the Commandos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/text_engine/multi_line_text.cc

    r7754 r7756  
    136136    if (width > maxWidth || this->getText()[i] == '\n')
    137137    {
    138       this->lineEnds.push_back(i);
    139       width = 0.0f;
     138      if (likely(i > 0))
     139      {
     140        this->lineEnds.push_back( i -1 );
     141        width = this->getFont()->getGlyphArray()[this->getText()[i-1]]->advance;
     142      }
     143      else
     144        width = 0.0f;
    140145    }
     146
    141147    // Advance the Text.
    142148    if(this->getFont()->getGlyphArray()[this->getText()[i]] != NULL)
Note: See TracChangeset for help on using the changeset viewer.