This commit is contained in:
Horis 2024-02-21 23:46:21 +08:00
parent 62f11ef178
commit a3254a4cdf
3 changed files with 4 additions and 2 deletions

View File

@ -665,7 +665,7 @@ class ReadView(context: Context, attrs: AttributeSet) :
val line = page.lines.first()
val durChapterPos = ReadBook.durChapterPos
val startPos = line.chapterPosition
val endPos = line.chapterPosition + line.charSize
val endPos = startPos + line.charSize
if (durChapterPos in startPos..<endPos) {
post {
upContent(resetPageOffset = false)

View File

@ -267,6 +267,8 @@ data class TextChapter(
fun setProgressListener(l: LayoutProgressListener) {
if (isCompleted) {
l.onLayoutCompleted()
} else if (layout?.exception != null) {
l.onLayoutException(layout?.exception!!)
} else {
listener = l
}

View File

@ -66,12 +66,12 @@ class TextChapterLayout(
private val stringBuilder = StringBuilder()
private var isCompleted = false
private var exception: Throwable? = null
private val job: Coroutine<*>
private val bookChapter inline get() = textChapter.chapter
private val displayTitle inline get() = textChapter.title
private val chaptersSize inline get() = textChapter.chaptersSize
var exception: Throwable? = null
init {
job = Coroutine.async(scope) {