Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug: when present RSKImageCropViewController in a iOS7 iPad in landscape mode, the cop mask's frame isn't correct. #59

Merged
merged 2 commits into from
Jul 8, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions RSKImageCropper/RSKImageCropViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ - (void)handleRotation:(UIRotationGestureRecognizer *)gestureRecognizer

- (BOOL)isPortraitInterfaceOrientation
{
return CGRectGetHeight(self.view.frame) > CGRectGetWidth(self.view.frame);
return CGRectGetHeight(self.view.bounds) > CGRectGetWidth(self.view.bounds);
}

#pragma mark - Private
Expand Down Expand Up @@ -677,8 +677,8 @@ - (void)updateMaskRect
{
switch (self.cropMode) {
case RSKImageCropModeCircle: {
CGFloat viewWidth = CGRectGetWidth(self.view.frame);
CGFloat viewHeight = CGRectGetHeight(self.view.frame);
CGFloat viewWidth = CGRectGetWidth(self.view.bounds);
CGFloat viewHeight = CGRectGetHeight(self.view.bounds);

CGFloat diameter;
if ([self isPortraitInterfaceOrientation]) {
Expand All @@ -696,8 +696,8 @@ - (void)updateMaskRect
break;
}
case RSKImageCropModeSquare: {
CGFloat viewWidth = CGRectGetWidth(self.view.frame);
CGFloat viewHeight = CGRectGetHeight(self.view.frame);
CGFloat viewWidth = CGRectGetWidth(self.view.bounds);
CGFloat viewHeight = CGRectGetHeight(self.view.bounds);

CGFloat length;
if ([self isPortraitInterfaceOrientation]) {
Expand Down