-
Notifications
You must be signed in to change notification settings - Fork 170
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
feat: Added flag to disable deformation of crop box #296
feat: Added flag to disable deformation of crop box #296
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
I added a couple of comments.
@@ -47,11 +48,12 @@ class CropAuxiliaryIndicatorView: UIView, CropAuxiliaryIndicatorViewProtocol { | |||
} | |||
} | |||
|
|||
init(frame: CGRect, cropBoxHotAreaUnit: CGFloat) { | |||
init(frame: CGRect, cropBoxHotAreaUnit: CGFloat, disableCropBoxDeformation: Bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a default value for disableCropBoxDeformation here, otherwise we need to update CropAuxiliaryIndicatorViewTests too.
@@ -28,6 +28,10 @@ extension CropView { | |||
} | |||
|
|||
private func isHitGridOverlayView(by touchPoint: CGPoint) -> Bool { | |||
guard !cropViewConfig.disableCropBoxDeformation else { | |||
return false | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this logic to where isHitGridOverlayView is called? Otherwise when cropViewConfig.disableCropBoxDeformation is true, it returns false but it actually hit the GridOverlayView. The logic works but not accurate as the function name describes.
…ceived in the initializer of CropAuxiliaryIndicatorView
@guoyingtao |
Hello.
I want to disable the deformation of the crop area, so I have added a flag for that.