mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-06-12 08:54:04 +09:00
fixed a bug where GDX version's getWidth() returns wrong value (and I don't really use GlyphLayout...)
This commit is contained in:
@@ -735,8 +735,7 @@ class GameFontBase(fontDir: String, val noShadow: Boolean = false, val flipY: Bo
|
|||||||
private val glyphLayout = GlyphLayout()
|
private val glyphLayout = GlyphLayout()
|
||||||
|
|
||||||
fun getWidth(text: String): Int {
|
fun getWidth(text: String): Int {
|
||||||
glyphLayout.setText(this, text)
|
return getWidthOfCharSeq(text).sum()
|
||||||
return glyphLayout.width.toInt()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user