From 38e7082107f045e67b4a47eafa6c2694d3be2d8e Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 19 Feb 2020 19:30:07 +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 --- .../book/read/page/delegate/SimulationPageDelegate.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt index 3bb257e72..4db78b74e 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt @@ -12,7 +12,8 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi //不让x,y为0,否则在点计算时会有问题 private var mTouchX = 0.1f private var mTouchY = 0.1f - private var mCornerX = 1 // 拖拽点对应的页脚 + // 拖拽点对应的页脚 + private var mCornerX = 1 private var mCornerY = 1 private val mPath0: Path = Path() private val mPath1: Path = Path() @@ -85,6 +86,8 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi override fun setStartPoint(x: Float, y: Float, invalidate: Boolean) { super.setStartPoint(x, y, invalidate) + mTouchX = x + mTouchY = y calcCornerXY(x, y) } @@ -171,15 +174,15 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi } override fun onScrollStop() { + if (!isCancel) { + pageView.fillPage(mDirection) + } prevBitmap?.recycle() prevBitmap = null nextBitmap?.recycle() nextBitmap = null curBitmap?.recycle() curBitmap = null - if (!isCancel) { - pageView.fillPage(mDirection) - } } override fun onDraw(canvas: Canvas) {