time to get off so i'll just commit this

This commit is contained in:
minjaesong
2020-09-29 18:04:58 +09:00
parent 45b431f953
commit 0eb181f315

View File

@@ -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 }