From 95ce792e4e7991cfaf59c491e932e6d8f7f337ec Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Oct 2012 14:43:32 +0400 Subject: modify ImageViewTouch to doubletap zoom to width by default --- src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/it/sephiroth/android/library') diff --git a/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java b/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java index eff1dd3..94bff44 100644 --- a/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java +++ b/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java @@ -127,11 +127,11 @@ public class ImageViewTouch extends ImageViewTouchBase { if ( mDoubleTapDirection == 1 ) { if (mCurrentScaleFactor - 1.0f < 0.01) { //( scale + ( mScaleFactor * 2 ) ) <= maxZoom - float w = getDrawable().getIntrinsicWidth() * mCurrentScaleFactor; + float w = getBitmapRect().right - getBitmapRect().left; float scaleFactor = mScaleFactor; if (w < getWidth()) { - scaleFactor = (getWidth() / w) - 1f + 0.1f; + scaleFactor = (float)getWidth() / (float)w - scale; } return scale + scaleFactor; -- cgit v1.2.3