fixed a bug where GDX version's getWidth() returns wrong value (and I don't really use GlyphLayout...)

This commit is contained in:
minjaesong
2017-07-04 00:07:10 +09:00
parent a59655d628
commit df51ca165b

View File

@@ -735,8 +735,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
private val glyphLayout = GlyphLayout()
fun getWidth(text: String): Int {
glyphLayout.setText(this, text)
return glyphLayout.width.toInt()
return getWidthOfCharSeq(text).sum()
}