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)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user