From 866e4d16199d1c7cf89bd99b4fe7787a669713a6 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 24 Feb 2020 18:50:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/read/page/ContentTextView.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 33388fc63..c06c74618 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -80,10 +80,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at } private fun drawScrollPage(canvas: Canvas) { + val mPageOffset = pageOffset textPage.textLines.forEach { textLine -> - val lineTop = textLine.lineTop + pageOffset - val lineBase = textLine.lineBase + pageOffset - val lineBottom = textLine.lineBottom + pageOffset + val lineTop = textLine.lineTop + mPageOffset + val lineBase = textLine.lineBase + mPageOffset + val lineBottom = textLine.lineBottom + mPageOffset drawChars( canvas, textLine.textChars, @@ -95,7 +96,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at ) } pageFactory.nextPage?.textLines?.forEach { textLine -> - val yPy = pageOffset + textPage.height - ChapterProvider.paddingTop + val yPy = mPageOffset + textPage.height - ChapterProvider.paddingTop val lineTop = textLine.lineTop + yPy val lineBase = textLine.lineBase + yPy val lineBottom = textLine.lineBottom + yPy @@ -110,7 +111,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at ) } pageFactory.prevPage?.textLines?.forEach { textLine -> - val yPy = pageOffset + ChapterProvider.paddingTop + val yPy = mPageOffset + ChapterProvider.paddingTop val lineTop = -textLine.lineTop + yPy val lineBase = -textLine.lineBase + yPy val lineBottom = -textLine.lineBottom + yPy