From 54b606d84c117f46cd43f0d0ca6f1f21e8766cce Mon Sep 17 00:00:00 2001 From: Timur Kuchkarov Date: Tue, 2 Dec 2014 13:32:16 +0600 Subject: [PATCH] Fix for infinite loop. Fix for infinite loop that appears if cropper is in some positions. --- BJImageCropper/BJImageCropper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BJImageCropper/BJImageCropper.m b/BJImageCropper/BJImageCropper.m index 6e80d03..6a4fc2f 100644 --- a/BJImageCropper/BJImageCropper.m +++ b/BJImageCropper/BJImageCropper.m @@ -64,7 +64,7 @@ - (void)constrainCropToImage { change = YES; } - if (CGOriginX(frame) + CGWidth(frame) > CGWidth(cropView.superview.frame)) { + if (CGOriginX(frame) + CGWidth(frame) - CGWidth(cropView.superview.frame) > 0.01) { frame.origin.x = CGWidth(cropView.superview.frame) - CGWidth(frame); change = YES; }