From 0e58e665d91f22890badf4bc34ff464e5adce19b Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Thu, 8 Aug 2013 10:05:41 +0200 Subject: [PATCH] fixed zoom limits so they can be one It should be possible to set zoom limits to one, e.g. when you don't want your image to be scalable down. Documentation also says that when DisplayType is FIT_TO_SCREEN, you have to set minZoom <= 1 and maxZoom >= 1, which includes the one. --- .../android/library/imagezoom/ImageViewTouchBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ImageViewTouch/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java b/ImageViewTouch/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java index 1eb3e93..6be5781 100644 --- a/ImageViewTouch/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java +++ b/ImageViewTouch/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java @@ -458,12 +458,12 @@ protected void _setImageDrawable( final Drawable drawable, final Matrix initial_ if ( mScaleType == DisplayType.FIT_TO_SCREEN || mScaleType == DisplayType.FIT_IF_BIGGER ) { - if ( mMinZoom >= 1 ) { + if ( mMinZoom > 1 ) { mMinZoomDefined = false; mMinZoom = ZOOM_INVALID; } - if ( mMaxZoom <= 1 ) { + if ( mMaxZoom < 1 ) { mMaxZoomDefined = true; mMaxZoom = ZOOM_INVALID; }