* Fix some errors in the string width computation.
This commit is contained in:
jean.chalard
2009-01-17 11:00:26 +00:00
parent 027e1b9bba
commit e978a7d168
+3 -3
View File
@@ -113,7 +113,7 @@ void JLBFont::DrawString(const char *string, float x, float y, int align)
else if (align == JGETEXT_CENTER) else if (align == JGETEXT_CENTER)
dx -= width/2; dx -= width/2;
dx = floorf(dx) + 0.1; dx = floorf(dx);
dy = floorf(dy); dy = floorf(dy);
int index; int index;
while (*p) while (*p)
@@ -162,9 +162,9 @@ float JLBFont::GetStringWidth(const char *string) const
ch = *p - 32; ch = *p - 32;
p++; p++;
if (ch < 0) continue; if (ch < 0) continue;
len += mCharWidth[ch+mBase]; len += mCharWidth[ch+mBase] + mTracking;
} }
len -= mTracking;
return len*mScale; return len*mScale;
} }