-
Notifications
You must be signed in to change notification settings - Fork 606
Make image diffing strategies custom scale aware #336
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
Make image diffing strategies custom scale aware #336
Conversation
@mbrandonw @stephencelis do you have an estimate when you will have time to review this PR? Due to this scaling issue the diffs are unusable for us at the moment. |
@ffittschen Thanks for this! I merged it into a fork and it worked perfectly. |
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.
Looks good to us! Just one small thing if you have time. If not we can make the change after merging.
* Add scale parameter to image diffing strategies * Use updated diffing in CALayer, UIView, UIViewController and SwiftUIView strategies * Pass scale through to CGPath and UIBezierPath strategies * Re-generate project file
Hey @stephencelis, I just noticed this was merged into master, not into main. Should I open a new PR against main or are you going to handle getting this into the right branch? |
[Update Fork] Make image diffing strategies custom scale aware (pointfreeco#336)
…_with_test_plans' into main * origin/master: Make image diffing strategies custom scale aware (pointfreeco#336) * fork1/rtl_support_with_test_plans: Update README Make configuration directory a subdirectory of file name directory Change snapshot directory url when SNAPSHOT_CONFIGURATION_NAME environment variable is available Remove layout direction trait override
* Add scale parameter to image diffing strategies * Use updated diffing in CALayer, UIView, UIViewController and SwiftUIView strategies * Pass scale through to CGPath and UIBezierPath strategies * Re-generate project file
This PR resolves the issue described in #324 and partially in #243.
When overriding the scale of image snapshots by setting the
displayScale
property of the passed trait collection, failure diffs were not rendered correctly because the screens scale was used to interpret the snapshot stored on disk.To resolve this issue, I introduced a new scale parameter to the image diffing strategies which falls back to the display scale if it's not set or the default undefined value
0.0
of theUITraitCollection
.