Fixed degree symbol not displaying

Fixed bug with degree symbol not displaying correctly in torque thanks
to the forums:
http://www.garagegames.com/community/forums/viewthread/125190/1#comment-804996
This commit is contained in:
Nathan Bowhay 2015-01-29 15:18:00 -08:00
parent 42126937e6
commit ac0ba27753

View file

@ -568,6 +568,7 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector<U32> &startLineOff
for (U32 i = 0; i < len;) for (U32 i = 0; i < len;)
{ {
U32 wide = 0;
startLine = i; startLine = i;
startLineOffset.push_back(startLine); startLineOffset.push_back(startLine);
@ -584,6 +585,10 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector<U32> &startLineOff
else if(isValidChar(txt[i])) else if(isValidChar(txt[i]))
{ {
lineStrWidth += getCharInfo(txt[i]).xIncrement; lineStrWidth += getCharInfo(txt[i]).xIncrement;
if(txt[i] < 0) // symbols which code > 127
{
wide++; i++;
}
if( lineStrWidth > lineWidth ) if( lineStrWidth > lineWidth )
{ {
needsNewLine = true; needsNewLine = true;
@ -595,7 +600,7 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector<U32> &startLineOff
if (!needsNewLine) if (!needsNewLine)
{ {
// we are done! // we are done!
lineLen.push_back(i - startLine); lineLen.push_back(i - startLine - wide);
return; return;
} }
@ -628,7 +633,7 @@ void GFont::wrapString(const UTF8 *txt, U32 lineWidth, Vector<U32> &startLineOff
} }
} }
lineLen.push_back(j - startLine); lineLen.push_back(j - startLine - wide);
i = j; i = j;
// Now we need to increment through any space characters at the // Now we need to increment through any space characters at the