mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-03-07 11:51:50 +09:00
better text scaling support
This commit is contained in:
@@ -20,7 +20,7 @@ import kotlin.math.*
|
||||
class MovableType(
|
||||
val font: TerrarumSansBitmap,
|
||||
val inputText: CodepointSequence,
|
||||
val paperWidth: Int,
|
||||
paperWidth: Int,
|
||||
internal val isNull: Boolean = false
|
||||
): Disposable {
|
||||
|
||||
@@ -285,7 +285,7 @@ class MovableType(
|
||||
font.drawNormalised(batch,
|
||||
it.block.text,
|
||||
x + it.posX,
|
||||
y + lineNum * lineHeight
|
||||
y + lineNum * lineHeight * font.scale
|
||||
)
|
||||
|
||||
if (it.colour != null)
|
||||
|
||||
@@ -766,10 +766,10 @@ class TerrarumSansBitmap(
|
||||
val cacheObj = getCache(s.getHash())
|
||||
|
||||
if (cacheObj != null) {
|
||||
return cacheObj.glyphLayout!!.width
|
||||
return cacheObj.glyphLayout!!.width * scale
|
||||
}
|
||||
else {
|
||||
return buildPosMap(s).width
|
||||
return buildPosMap(s).width * scale
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user