From 7a66f55d50f8b83f8029843934ec2240d331044e Mon Sep 17 00:00:00 2001 From: yinpengcheng Date: Tue, 27 Nov 2018 19:50:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=8C=E5=87=BB=E5=9C=A8?= =?UTF-8?q?=E5=B7=B2=E6=94=BE=E5=A4=A7=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E4=BB=8D=E7=84=B6=E6=94=BE=E5=A4=A7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bm/library/PhotoView.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/library/src/main/java/com/bm/library/PhotoView.java b/library/src/main/java/com/bm/library/PhotoView.java index 2a2de96..f41cc55 100644 --- a/library/src/main/java/com/bm/library/PhotoView.java +++ b/library/src/main/java/com/bm/library/PhotoView.java @@ -911,13 +911,25 @@ public boolean onDoubleTap(MotionEvent e) { mTranslateY = 0; if (isZoonUp) { - from = mScale; - to = 1; + if (mScale == 1){ + isZoonUp = false; + from = mScale; + to = mMaxScale; + mScaleCenter.set(e.getX(), e.getY()); + }else { + from = mScale; + to = 1; + } } else { - from = mScale; - to = mMaxScale; - - mScaleCenter.set(e.getX(), e.getY()); + if (mScale == mMaxScale){ + isZoonUp = true; + from = mScale; + to = 1; + }else { + from = mScale; + to = mMaxScale; + mScaleCenter.set(e.getX(), e.getY()); + } } mTmpMatrix.reset();