From 5b8174d644e76879e6091bd2d8733d589d27d1dc Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 19 Feb 2020 19:55:15 +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, 3 insertions(+), 8 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 dac62fea2..106fd0a3e 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 @@ -86,8 +86,6 @@ 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) } @@ -97,13 +95,13 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi if ((startY > viewHeight * 0.33 && startY < viewHeight * 0.66) || mDirection == Direction.PREV ) { - mTouchY = viewHeight.toFloat() + touchY = viewHeight.toFloat() } if (startY > viewHeight * 0.33 && startY < viewHeight / 2.0 && mDirection == Direction.NEXT ) { - mTouchY = 1f + touchY = 1f } } @@ -355,10 +353,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi } var rotateDegrees: Float = Math.toDegrees( - atan2( - mTouchX - mBezierControl1.x, - mBezierControl1.y - mTouchY - ).toDouble() + atan2(mTouchX - mBezierControl1.x, mBezierControl1.y - mTouchY).toDouble() ) .toFloat() canvas.rotate(rotateDegrees, mBezierControl1.x, mBezierControl1.y)