File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Objective-C/TOCropViewController/Views Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1403,9 +1403,12 @@ - (void)setAspectRatio:(CGSize)aspectRatio animated:(BOOL)animated
14031403 return ;
14041404 }
14051405
1406+ BOOL zoomOut = NO ;
1407+
14061408 // Passing in an empty size will revert back to the image aspect ratio
14071409 if (aspectRatio.width < FLT_EPSILON && aspectRatio.height < FLT_EPSILON) {
14081410 aspectRatio = (CGSize){self.imageSize .width , self.imageSize .height };
1411+ zoomOut = YES ; // Prevent from steadily zooming in when cycling between alternate aspectRatios and original
14091412 }
14101413
14111414 CGRect boundsFrame = self.contentBounds ;
@@ -1418,7 +1421,6 @@ - (void)setAspectRatio:(CGSize)aspectRatio animated:(BOOL)animated
14181421 else
14191422 cropBoxIsPortrait = aspectRatio.width < aspectRatio.height ;
14201423
1421- BOOL zoomOut = NO ;
14221424 if (cropBoxIsPortrait) {
14231425 CGFloat newWidth = floorf (cropBoxFrame.size .height * (aspectRatio.width /aspectRatio.height ));
14241426 CGFloat delta = cropBoxFrame.size .width - newWidth;
You can’t perform that action at this time.
0 commit comments