From 4320bd1cc37eaa454d19549de6e4dc8e29c557a5 Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Mon, 23 Dec 2024 21:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../read/page/provider/TextChapterLayout.kt | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt index 0766c83ded24..0bd547adaf26 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt @@ -342,34 +342,23 @@ class TextChapterLayout( } Book.imgStyleSingle -> { - width = ChapterProvider.visibleWidth - height = size.height * ChapterProvider.visibleWidth / size.width - if (height > ChapterProvider.visibleHeight) { - width = width * ChapterProvider.visibleHeight / height - height = ChapterProvider.visibleHeight + width = visibleWidth + height = size.height * visibleWidth / size.width + if (height > visibleHeight) { + width = width * visibleHeight / height + height = visibleHeight } if (durY > 0f) { val textPage = pendingTextPage - // 双页的 durY 不正确,可能会小于实际高度 if (textPage.height < durY) { textPage.height = durY } - if (doublePage && absStartX < viewWidth / 2) { - //当前页面左列结束 - textPage.leftLineSize = textPage.lineSize - absStartX = viewWidth / 2 + paddingLeft - } else { - //当前页面结束 - if (textPage.leftLineSize == 0) { - textPage.leftLineSize = textPage.lineSize - } - textPage.text = stringBuilder.toString().ifEmpty { "本页无文字内容" } - stringBuilder.clear() - textPages.add(textPage) - coroutineContext.ensureActive() - onPageCompleted() - pendingTextPage = TextPage() - } + textPage.text = stringBuilder.toString().ifEmpty { "本页无文字内容" } + stringBuilder.clear() + textPages.add(textPage) + coroutineContext.ensureActive() + onPageCompleted() + pendingTextPage = TextPage() durY = 0f } }