From cecaae7f18cff8170bcae453290517402e594c77 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 19 Feb 2020 16:34:43 +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 | 10 ++++------ 1 file changed, 4 insertions(+), 6 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 bcd4f1bad..f7295f878 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 @@ -485,8 +485,8 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi * 计算拖拽点对应的拖拽脚 */ private fun calcCornerXY(x: Float, y: Float) { - mCornerX = if (x <= viewWidth / 2.0) 0 else viewWidth - mCornerY = if (y <= viewHeight / 2.0) 0 else viewHeight + mCornerX = if (x <= viewWidth * 0.5) 0 else viewWidth + mCornerY = if (y <= viewHeight * 0.5) 0 else viewHeight mIsRtOrLb = (mCornerX == 0 && mCornerY == viewHeight) || (mCornerX == viewWidth && mCornerY == 0) } @@ -498,8 +498,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi mMiddleX - (mCornerY - mMiddleY) * (mCornerY - mMiddleY) / (mCornerX - mMiddleX) mBezierControl1.y = mCornerY.toFloat() mBezierControl2.x = mCornerX.toFloat() - val f4 = mCornerY - mMiddleY - mBezierControl2.y = if (f4 == 0f) { + mBezierControl2.y = if ((mCornerY - mMiddleY).toInt() == 0) { mMiddleY - (mCornerX - mMiddleX) * (mCornerX - mMiddleX) / 0.1f } else { mMiddleY - (mCornerX - mMiddleX) * (mCornerX - mMiddleX) / (mCornerY - mMiddleY) @@ -522,8 +521,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi mMiddleX - (mCornerY - mMiddleY) * (mCornerY - mMiddleY) / (mCornerX - mMiddleX) mBezierControl1.y = mCornerY.toFloat() mBezierControl2.x = mCornerX.toFloat() - val f5 = mCornerY - mMiddleY - mBezierControl2.y = if (f5 == 0f) { + mBezierControl2.y = if ((mCornerY - mMiddleY).toInt() == 0) { mMiddleY - (mCornerX - mMiddleX) * (mCornerX - mMiddleX) / 0.1f } else { mMiddleY - (mCornerX - mMiddleX) * (mCornerX - mMiddleX) / (mCornerY - mMiddleY)