Fix Segmentation Fault & Formatting

This commit is contained in:
Anthony Calosa
2015-11-10 11:58:36 +08:00
parent 406f68ac5b
commit cd1b629191
71 changed files with 769 additions and 769 deletions

View File

@@ -328,13 +328,13 @@ std::string wordWrap(const std::string& sentence, float width, int fontId)
string currentSentence = sentence.substr(breakIdx, idx - breakIdx);
float stringLength = mFont->GetStringWidth( currentSentence.c_str() );
if (stringLength >= width)
{
{
if ( stringLength > width )
{
while ( sentence[idx-1] != ' ' )
idx--;
}
retVal[idx-1] = '\n';
retVal[idx-1] = '\n';
breakIdx = idx;
numLines++;
}
@@ -344,12 +344,12 @@ std::string wordWrap(const std::string& sentence, float width, int fontId)
string currentSentence = sentence.substr(breakIdx, idx - breakIdx);
float stringLength = mFont->GetStringWidth( currentSentence.c_str() );
if (stringLength >= width)
{
{
if ( stringLength > width )
{
while ( sentence[idx-1] != ' ' )
idx--;
retVal[idx-1] = '\n';
retVal[idx-1] = '\n';
}
numLines++;
}