Horis 1 год назад
Родитель
Сommit
634f610915

+ 8 - 3
app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt

@@ -803,14 +803,19 @@ class TextChapterLayout(
         var i = 0
         while (i < length) {
             val clusterBaseIndex = i++
-            widths.add(widthsArray[start + clusterBaseIndex])
+            var extra = 0f
             while (i < length) {
                 val c = text[i]
-                if ((widthsArray[start + i] > 0 && !c.isLowSurrogate()) || isZeroWidthChar(c)) {
-                    break
+                val w = widthsArray[start + i]
+                if (w > 0 || isZeroWidthChar(c)) {
+                    if (!c.isLowSurrogate()) {
+                        break
+                    }
+                    extra = w
                 }
                 i++
             }
+            widths.add(widthsArray[start + clusterBaseIndex] + extra)
             stringList.add(text.substring(clusterBaseIndex, i))
         }
         return stringList to widths