From 81cd7d65c3eb375240024f123e3acac56fa5f53c Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 19 Feb 2020 20:42:35 +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 --- .../ui/book/read/page/delegate/SimulationPageDelegate.kt | 7 +++---- 1 file changed, 3 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 0f3f625e2..1d0e1ec19 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 @@ -301,9 +301,9 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi */ private fun drawCurrentPageShadow(canvas: Canvas) { val degree: Double = if (mIsRtOrLb) { - (Math.PI / 4 - atan2(mBezierControl1.y - mTouchX, mTouchX - mBezierControl1.x)) + Math.PI / 4 - atan2(mBezierControl1.y - mTouchY, mTouchX - mBezierControl1.x) } else { - (Math.PI / 4 - atan2(mTouchY - mBezierControl1.y, mTouchX - mBezierControl1.x)) + Math.PI / 4 - atan2(mTouchY - mBezierControl1.y, mTouchX - mBezierControl1.x) } // 翻起页阴影顶点与touch点的距离 val d1 = 25.toFloat() * 1.414 * cos(degree) @@ -343,8 +343,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi var rotateDegrees: Float = Math.toDegrees( atan2(mTouchX - mBezierControl1.x, mBezierControl1.y - mTouchY).toDouble() - ) - .toFloat() + ).toFloat() canvas.rotate(rotateDegrees, mBezierControl1.x, mBezierControl1.y) mCurrentPageShadow.setBounds( leftX, (mBezierControl1.y - mMaxLength).toInt(),