This commit is contained in:
Horis 2024-02-24 19:56:34 +08:00
parent 36e6c0c8a4
commit 5cef6f8e39
2 changed files with 11 additions and 11 deletions

View File

@ -232,11 +232,11 @@ object ReadBook : CoroutineScope by MainScope() {
nextTextChapter = null
if (curTextChapter == null) {
AppLog.putDebug("moveToNextChapter-章节未加载,开始加载")
if (upContentInPlace) callBack?.upContent(resetPageOffset = false)
if (upContentInPlace) callBack?.upContent()
loadContent(durChapterIndex, upContent, resetPageOffset = false)
} else if (upContent && upContentInPlace) {
AppLog.putDebug("moveToNextChapter-章节已加载,刷新视图")
callBack?.upContent(resetPageOffset = false)
callBack?.upContent()
}
loadContent(durChapterIndex.plus(1), upContent, false)
saveRead()
@ -263,10 +263,10 @@ object ReadBook : CoroutineScope by MainScope() {
curTextChapter = prevTextChapter
prevTextChapter = null
if (curTextChapter == null) {
if (upContentInPlace) callBack?.upContent(resetPageOffset = false)
if (upContentInPlace) callBack?.upContent()
loadContent(durChapterIndex, upContent, resetPageOffset = false)
} else if (upContent && upContentInPlace) {
callBack?.upContent(resetPageOffset = false)
callBack?.upContent()
}
loadContent(durChapterIndex.minus(1), upContent, false)
saveRead()

View File

@ -336,6 +336,10 @@ class TextChapterLayout(
}
if (durY + height > visibleHeight) {
val textPage = pendingTextPage
// 双页的 durY 不正确,可能会小于实际高度
if (textPage.height < durY) {
textPage.height = durY
}
if (doublePage && absStartX < viewWidth / 2) {
//当前页面左列结束
textPage.leftLineSize = textPage.lineSize
@ -352,10 +356,6 @@ class TextChapterLayout(
onPageCompleted()
pendingTextPage = TextPage()
}
// 双页的 durY 不正确,可能会小于实际高度
if (textPage.height < durY) {
textPage.height = durY
}
durY = 0f
}
}
@ -434,6 +434,9 @@ class TextChapterLayout(
val textLine = TextLine(isTitle = isTitle)
if (durY + textHeight > visibleHeight) {
val textPage = pendingTextPage
if (textPage.height < durY) {
textPage.height = durY
}
if (doublePage && absStartX < viewWidth / 2) {
//当前页面左列结束
textPage.leftLineSize = textPage.lineSize
@ -452,9 +455,6 @@ class TextChapterLayout(
stringBuilder.clear()
absStartX = paddingLeft
}
if (textPage.height < durY) {
textPage.height = durY
}
durY = 0f
}
val lineStart = layout.getLineStart(lineIndex)