-
Notifications
You must be signed in to change notification settings - Fork 46
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 ratio calculation bug #1123
Conversation
…nto fix/logo-ratio-bug
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.
Great work @danielamorse , from my perspective look perfect 👍
…s with decimals work as expected
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.
Nice job @danielamorse - this looks great!
As discussed, my only 2 cents on this is that I added two extra tests to make sure we're checking to make sure ratios that have fraction data contain decimals also works (just in case). Approved 👍
Jira
Summary
Details
Previously, in
ratio.twig
we were dividing ratio height or width values by 100 when the value was > 100. This worked fine when both values were either > 100 or < 100 but failed when one was above and the other below. The error would miscalculate the aspect ratio, causing the visual regression we saw with the logo.Instead of dividing by 100, I'm now getting the greatest common divisor of our ratio values (via a new twig function). I added VR tests for logo and updated the tests to use the new reduced fractions.
How to test