Fix Segmentation Fault & Formatting
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user