优化
This commit is contained in:
@@ -803,14 +803,19 @@ class TextChapterLayout(
|
|||||||
var i = 0
|
var i = 0
|
||||||
while (i < length) {
|
while (i < length) {
|
||||||
val clusterBaseIndex = i++
|
val clusterBaseIndex = i++
|
||||||
widths.add(widthsArray[start + clusterBaseIndex])
|
var extra = 0f
|
||||||
while (i < length) {
|
while (i < length) {
|
||||||
val c = text[i]
|
val c = text[i]
|
||||||
if ((widthsArray[start + i] > 0 && !c.isLowSurrogate()) || isZeroWidthChar(c)) {
|
val w = widthsArray[start + i]
|
||||||
break
|
if (w > 0 || isZeroWidthChar(c)) {
|
||||||
|
if (!c.isLowSurrogate()) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
extra = w
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
widths.add(widthsArray[start + clusterBaseIndex] + extra)
|
||||||
stringList.add(text.substring(clusterBaseIndex, i))
|
stringList.add(text.substring(clusterBaseIndex, i))
|
||||||
}
|
}
|
||||||
return stringList to widths
|
return stringList to widths
|
||||||
|
|||||||
Reference in New Issue
Block a user