Skip to content

Commit 836e6dc

Browse files
committed
修复iOS13裁剪错误的问题
1 parent 8a652a5 commit 836e6dc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

TZImagePickerController/TZImagePickerController/TZImagePickerController.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ @interface TZImagePickerController () {
2121
UIButton *_settingBtn;
2222
BOOL _pushPhotoPickerVc;
2323
BOOL _didPushPhotoPickerVc;
24+
CGRect _cropRect;
2425

2526
UIButton *_progressHUD;
2627
UIView *_HUDContainer;
@@ -493,6 +494,18 @@ - (void)setCropRect:(CGRect)cropRect {
493494
_cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, cropRect.origin.x, widthHeight, widthHeight);
494495
}
495496

497+
- (CGRect)cropRect {
498+
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
499+
BOOL isFullScreen = self.view.tz_height == screenHeight;
500+
if (isFullScreen) {
501+
return _cropRect;
502+
} else {
503+
CGRect newCropRect = _cropRect;
504+
newCropRect.origin.y -= ((screenHeight - self.view.tz_height) / 2);
505+
return newCropRect;
506+
}
507+
}
508+
496509
- (void)setTimeout:(NSInteger)timeout {
497510
_timeout = timeout;
498511
if (timeout < 5) {

0 commit comments

Comments
 (0)