From 92bac6ebdc64411987db2e625a1956df28cc487b Mon Sep 17 00:00:00 2001 From: jacob-tabak Date: Tue, 19 Aug 2014 13:31:16 -0400 Subject: [PATCH] removed unnecessary if statement / redundant code --- .../library/imagezoom/ImageViewTouchBase.java | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/library/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java b/library/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java index c59510c..5ecde48 100644 --- a/library/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java +++ b/library/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java @@ -658,26 +658,14 @@ protected void getProperBaseMatrix( Drawable drawable, Matrix matrix ) { float widthScale, heightScale; matrix.reset(); - if ( w > viewWidth || h > viewHeight ) { - widthScale = viewWidth / w; - heightScale = viewHeight / h; - float scale = Math.min( widthScale, heightScale ); - matrix.postScale( scale, scale ); - - float tw = ( viewWidth - w * scale ) / 2.0f; - float th = ( viewHeight - h * scale ) / 2.0f; - matrix.postTranslate( tw, th ); - - } else { - widthScale = viewWidth / w; - heightScale = viewHeight / h; - float scale = Math.min( widthScale, heightScale ); - matrix.postScale( scale, scale ); + widthScale = viewWidth / w; + heightScale = viewHeight / h; + float scale = Math.min( widthScale, heightScale ); + matrix.postScale( scale, scale ); - float tw = ( viewWidth - w * scale ) / 2.0f; - float th = ( viewHeight - h * scale ) / 2.0f; - matrix.postTranslate( tw, th ); - } + float tw = ( viewWidth - w * scale ) / 2.0f; + float th = ( viewHeight - h * scale ) / 2.0f; + matrix.postTranslate( tw, th ); if( LOG_ENABLED ) { printMatrix( matrix );