From 3ac31ec7e47a53d59fab637c37f3344dd8e266ae Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:38:21 +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 --- .../io/legado/app/ui/book/read/page/entities/TextPage.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 bdee00d0c..ef26ab11a 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 @@ -290,11 +290,11 @@ data class TextPage( fun draw(view: ContentTextView, canvas: Canvas, relativeOffset: Float) { if (AppConfig.optimizeRender) { render(view) - canvas.withTranslation(0f, relativeOffset + paddingTop) { + canvas.withTranslation(0f, relativeOffset) { canvasRecorder.draw(this) } } else { - canvas.withTranslation(0f, relativeOffset + paddingTop) { + canvas.withTranslation(0f, relativeOffset) { drawPage(view, this) } } @@ -318,7 +318,7 @@ data class TextPage( private fun drawPage(view: ContentTextView, canvas: Canvas) { for (i in lines.indices) { val line = lines[i] - canvas.withTranslation(0f, line.lineTop - paddingTop) { + canvas.withTranslation(0f, line.lineTop) { line.draw(view, this) } } @@ -326,7 +326,7 @@ data class TextPage( fun render(view: ContentTextView): Boolean { if (!isCompleted) return false - return canvasRecorder.recordIfNeeded(view.width, height.toInt()) { + return canvasRecorder.recordIfNeeded(view.width, view.height) { drawPage(view, this) } }