summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-10-17 14:43:32 +0400
committerAndrew Dolgov <[email protected]>2012-10-17 14:43:32 +0400
commit95ce792e4e7991cfaf59c491e932e6d8f7f337ec (patch)
tree25cfc1ce317d05936feaac8d2316cbdebe089cc3 /src
parent7a3c544825e7c6c7fe3af8b947f2ea463b4723cb (diff)
modify ImageViewTouch to doubletap zoom to width by default
Diffstat (limited to 'src')
-rw-r--r--src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java4
1 files changed, 2 insertions, 2 deletions
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;