diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt index 356199690..ef7c9c9f0 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt @@ -24,8 +24,13 @@ data class TextPage( fun upPageAloudSpan(pageStart: Int) { if (text is SpannableStringBuilder) { removePageAloudSpan() + var lineStart = 0 for (textLine in textLines) { - + if (pageStart > lineStart && pageStart < lineStart + textLine.text.length) { + textLine.isReadAloud = true + break + } + lineStart += textLine.text.length } } }