Skip to content

Commit 8d6c788

Browse files
圆形裁剪时 设置了cropRect 由于_cropBgView里是一个对称的画圆 而_cropView是设置的圆角边框白线 逻辑不一致 造成 镂空圈和白圈位置不同 所以改为画圆角矩形 目前的写法 修正了圆形时 不管rect在哪 都能保持一致 但是如果不是圆形 可能还会有问题 建议把两个的裁切都换成椭圆 更加完美
1 parent 5a7e69d commit 8d6c788

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TZImagePickerController/TZImagePickerController/TZImageCropManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ + (void)overlayClippingWithView:(UIView *)view cropRect:(CGRect)cropRect contain
1919
UIBezierPath *path= [UIBezierPath bezierPathWithRect:[UIScreen mainScreen].bounds];
2020
CAShapeLayer *layer = [CAShapeLayer layer];
2121
if (needCircleCrop) { // 圆形裁剪框
22-
[path appendPath:[UIBezierPath bezierPathWithArcCenter:containerView.center radius:cropRect.size.width / 2 startAngle:0 endAngle: 2 * M_PI clockwise:NO]];
22+
[path appendPath:[UIBezierPath bezierPathWithRoundedRect:cropRect cornerRadius:cropRect.size.width / 2]];
2323
} else { // 矩形裁剪框
2424
[path appendPath:[UIBezierPath bezierPathWithRect:cropRect]];
2525
}

0 commit comments

Comments
 (0)