J :
* Fix some errors in the string width computation.
This commit is contained in:
+3
-3
@@ -113,7 +113,7 @@ void JLBFont::DrawString(const char *string, float x, float y, int align)
|
||||
else if (align == JGETEXT_CENTER)
|
||||
dx -= width/2;
|
||||
|
||||
dx = floorf(dx) + 0.1;
|
||||
dx = floorf(dx);
|
||||
dy = floorf(dy);
|
||||
int index;
|
||||
while (*p)
|
||||
@@ -162,9 +162,9 @@ float JLBFont::GetStringWidth(const char *string) const
|
||||
ch = *p - 32;
|
||||
p++;
|
||||
if (ch < 0) continue;
|
||||
len += mCharWidth[ch+mBase];
|
||||
len += mCharWidth[ch+mBase] + mTracking;
|
||||
}
|
||||
|
||||
len -= mTracking;
|
||||
return len*mScale;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user