mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -128,14 +128,14 @@ data class TextPage(
|
||||
for ((index, textLine) in textLines.withIndex()) {
|
||||
if (aloudSpanStart > lineStart && aloudSpanStart < lineStart + textLine.text.length) {
|
||||
for (i in index - 1 downTo 0) {
|
||||
if (textLines[i].text.endsWith("\n")) {
|
||||
if (textLines[i].isLastLine) {
|
||||
break
|
||||
} else {
|
||||
textLines[i].isReadAloud = true
|
||||
}
|
||||
}
|
||||
for (i in index until textLines.size) {
|
||||
if (textLines[i].text.endsWith("\n")) {
|
||||
if (textLines[i].isLastLine) {
|
||||
textLines[i].isReadAloud = true
|
||||
break
|
||||
} else {
|
||||
|
||||
@@ -377,7 +377,9 @@ object ChapterProvider {
|
||||
}
|
||||
}
|
||||
stringBuilder.append(words)
|
||||
if (textLine.isLastLine) stringBuilder.append("\n")
|
||||
if (textLine.isLastLine) {
|
||||
stringBuilder.append("\n")
|
||||
}
|
||||
textPages.last().textLines.add(textLine)
|
||||
textLine.upTopBottom(durY, textPaint)
|
||||
durY += textPaint.textHeight * lineSpacingExtra
|
||||
|
||||
Reference in New Issue
Block a user