diff --git a/Objective-C/TOCropViewController/Views/TOCropView.m b/Objective-C/TOCropViewController/Views/TOCropView.m index adf68d9e..65aca615 100755 --- a/Objective-C/TOCropViewController/Views/TOCropView.m +++ b/Objective-C/TOCropViewController/Views/TOCropView.m @@ -1403,9 +1403,12 @@ - (void)setAspectRatio:(CGSize)aspectRatio animated:(BOOL)animated return; } + BOOL zoomOut = NO; + // Passing in an empty size will revert back to the image aspect ratio if (aspectRatio.width < FLT_EPSILON && aspectRatio.height < FLT_EPSILON) { aspectRatio = (CGSize){self.imageSize.width, self.imageSize.height}; + zoomOut = YES; // Prevent from steadily zooming in when cycling between alternate aspectRatios and original } CGRect boundsFrame = self.contentBounds; @@ -1418,7 +1421,6 @@ - (void)setAspectRatio:(CGSize)aspectRatio animated:(BOOL)animated else cropBoxIsPortrait = aspectRatio.width < aspectRatio.height; - BOOL zoomOut = NO; if (cropBoxIsPortrait) { CGFloat newWidth = floorf(cropBoxFrame.size.height * (aspectRatio.width/aspectRatio.height)); CGFloat delta = cropBoxFrame.size.width - newWidth;