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

feat: Added flag to disable deformation of crop box #296

Merged
merged 3 commits into from
Apr 12, 2023

Conversation

tyomashin
Copy link
Contributor

Hello.

I want to disable the deformation of the crop area, so I have added a flag for that.

output

Copy link
Owner

@guoyingtao guoyingtao left a 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) {
Copy link
Owner

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
}
Copy link
Owner

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.

@tyomashin
Copy link
Contributor Author

@guoyingtao
Thank you for your review.
I have corrected the areas you mentioned.
Could you please check again?

@guoyingtao guoyingtao merged commit ba65283 into guoyingtao:master Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants