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

Oval crop corners added #307

Merged
merged 7 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [unreleased 4.0.2]
### Added
- Added provision to add Oval crop corners when the crop style is Rectangle [#305](https://github.com/CanHub/Android-Image-Cropper/issues/305)

## [4.0.1] - unreleased
### Fixed
- When TakePictureContract returns false or null return null result. [#287](https://github.com/CanHub/Android-Image-Cropper/issues/287)
Expand Down
8 changes: 4 additions & 4 deletions cropper/src/main/java/com/canhub/cropper/CropOverlayView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -908,28 +908,28 @@ class CropOverlayView
) {
// Top left
canvas.drawCircle(
rect.left,
rect.left - cornerExtension,
(rect.top - cornerExtension),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this change to align properly the corners over the edges of the rectangle. Observed this while checking it for smaller radius.

radius,
mBorderCornerPaint!!
)
// Top right
canvas.drawCircle(
rect.right + cornerOffset,
rect.right + cornerExtension,
rect.top - cornerExtension,
radius,
mBorderCornerPaint!!
)
// Bottom left
canvas.drawCircle(
rect.left - cornerOffset,
rect.left - cornerExtension,
rect.bottom + cornerExtension,
radius,
mBorderCornerPaint!!
)
// Bottom right
canvas.drawCircle(
rect.right + cornerOffset,
rect.right + cornerExtension,
rect.bottom + cornerExtension,
radius,
mBorderCornerPaint!!
Expand Down