mirror of
https://github.com/curioustorvald/Terrarum-sans-bitmap.git
synced 2026-06-12 17:04:03 +09:00
time to get off so i'll just commit this
This commit is contained in:
@@ -427,7 +427,7 @@ class GameFontBase(
|
|||||||
if (cacheObj == null || flagFirstRun) {
|
if (cacheObj == null || flagFirstRun) {
|
||||||
textBuffer = charSeq.toCodePoints()
|
textBuffer = charSeq.toCodePoints()
|
||||||
|
|
||||||
val (posXbuffer, posYbuffer) = buildWidthAndPosBuffers(textBuffer)
|
val (posXbuffer, posYbuffer) = buildPosMap(textBuffer)
|
||||||
|
|
||||||
flagFirstRun = false
|
flagFirstRun = false
|
||||||
|
|
||||||
@@ -853,7 +853,7 @@ class GameFontBase(
|
|||||||
return cacheObj.glyphLayout!!.width
|
return cacheObj.glyphLayout!!.width
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return buildWidthAndPosBuffers(s).first.last()
|
return buildPosMap(s).first.last()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -862,7 +862,7 @@ class GameFontBase(
|
|||||||
/**
|
/**
|
||||||
* posXbuffer's size is greater than the string, last element marks the width of entire string.
|
* posXbuffer's size is greater than the string, last element marks the width of entire string.
|
||||||
*/
|
*/
|
||||||
private fun buildWidthAndPosBuffers(str: CodepointSequence): Pair<IntArray, IntArray> {
|
private fun buildPosMap(str: CodepointSequence): Pair<IntArray, IntArray> {
|
||||||
val posXbuffer = IntArray(str.size + 1) { 0 }
|
val posXbuffer = IntArray(str.size + 1) { 0 }
|
||||||
val posYbuffer = IntArray(str.size) { 0 }
|
val posYbuffer = IntArray(str.size) { 0 }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user