-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix bug: Rotated UIImage lose origin scale and blured. #904
fix bug: Rotated UIImage lose origin scale and blured. #904
Conversation
Codecov Report
@@ Coverage Diff @@
## master #904 +/- ##
=======================================
Coverage 95.39% 95.39%
=======================================
Files 100 100
Lines 3626 3626
=======================================
Hits 3459 3459
Misses 167 167
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Generated by 🚫 Danger |
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.
Please add a CHANGELOG entry and perhaps update the tests
* fix UIImage rotated(by:) lose origin scale * add change log
CHANGELOG entry is added, all tests is OK and passed. |
Co-authored-by: Luciano Almeida <[email protected]>
add parameter doc Co-authored-by: Luciano Almeida <[email protected]>
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.
LGTM! Thanks :)
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.
I personally strongly dislike the /*opaque*/
comments, but 🤷♂️
Ahh feel free to request changes, I personally find useful for literals and use a lot at work with C++ because functions don't have labels there, so we use this pattern to make it easier to read at call site what the parameter means e.g. @Yanpanpan it is good to go can you just revert this so we can merge? :) |
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.
Ok fine, let's get rid of it...
@@ -139,7 +139,7 @@ public extension UIImage { | |||
width: destRect.width.rounded(), | |||
height: destRect.height.rounded()) | |||
|
|||
UIGraphicsBeginImageContext(roundedDestRect.size) | |||
UIGraphicsBeginImageContextWithOptions(roundedDestRect.size, /*opaque=*/false, scale) |
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.
UIGraphicsBeginImageContextWithOptions(roundedDestRect.size, /*opaque=*/false, scale) | |
UIGraphicsBeginImageContextWithOptions(roundedDestRect.size, false, scale) |
@@ -169,7 +169,7 @@ public extension UIImage { | |||
width: destRect.width.rounded(), | |||
height: destRect.height.rounded()) | |||
|
|||
UIGraphicsBeginImageContext(roundedDestRect.size) | |||
UIGraphicsBeginImageContextWithOptions(roundedDestRect.size, /*opaque=*/false, scale) |
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.
UIGraphicsBeginImageContextWithOptions(roundedDestRect.size, /*opaque=*/false, scale) | |
UIGraphicsBeginImageContextWithOptions(roundedDestRect.size, false, scale) |
I personally think removing |
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.
Thank you!
Thank you for contributing to SwifterSwift! I've invited you to join the SwifterSwift GitHub organization - no pressure to accept! If you'd like more information on what that means, check out our contributing guidelines. Feel free to reach out if you have any questions! 😃 |
Fix bug. When UIImage rotated, it lost origin scale.
Checklist
@available
if not.