Add more unit tests for rounding values to pixel grid #1776

Closed
rshest wants to merge 2 commits from export-D67712673 into main
rshest commented 2024-12-30 01:59:05 -08:00 (Migrated from github.com)

Summary:

Changelog:

[Internal] -

I was looking into some profiling results and noticed that Yoga has some quirky custom logic when it comes to rounding to the pixel grid, especially for the values that are halfway through.

There are already unit tests in place, but those cases weren't covered, so I am adding these extra corner cases here, to make sure they are covered in case that the actual rounding function may get modified (which it might make sense to, as it's currently can be more expensive than it could have been in some scenarios).

Differential Revision: D67712673

Summary: # Changelog: [Internal] - I was looking into some profiling results and noticed that Yoga has some quirky custom logic when it comes to rounding to the pixel grid, especially for the values that are halfway through. There are already unit tests in place, but those cases weren't covered, so I am adding these extra corner cases here, to make sure they are covered in case that the actual rounding function may get modified (which it might make sense to, as it's currently can be more expensive than it could have been in some scenarios). Differential Revision: D67712673
vercel[bot] commented 2024-12-30 01:59:10 -08:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoga-website Ready (Inspect) Visit Preview 💬 Add feedback Dec 30, 2024 10:54am
[vc]: #8+YOdkEkqVO53IklTjddx8lqWZuV4w7vtQJRzVy8Z4A=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ5b2dhLXdlYnNpdGUiLCJyb290RGlyZWN0b3J5Ijoid2Vic2l0ZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9mYm9wZW5zb3VyY2UveW9nYS13ZWJzaXRlL0M4SnNXOXpGNnlabVRpNExXcUY1V0pzd2JaYnUiLCJwcmV2aWV3VXJsIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLXJzaGVzdC1leHBvcnQtZDY3NzEyNjczLWZib3BlbnNvdXJjZS52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6InlvZ2Etd2Vic2l0ZS1naXQtZm9yay1yc2hlc3QtZXhwb3J0LWQ2NzcxMjY3My1mYm9wZW5zb3VyY2UudmVyY2VsLmFwcCJ9fV19 **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more) | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **yoga-website** | ✅ Ready ([Inspect](https://vercel.com/fbopensource/yoga-website/C8JsW9zF6yZmTi4LWqF5WJswbZbu)) | [Visit Preview](https://yoga-website-git-fork-rshest-export-d67712673-fbopensource.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/yoga-website-git-fork-rshest-export-d67712673-fbopensource.vercel.app?via=pr-comment-feedback-link) | Dec 30, 2024 10:54am |
facebook-github-bot commented 2024-12-30 01:59:17 -08:00 (Migrated from github.com)

This pull request was exported from Phabricator. Differential Revision: D67712673

This pull request was **exported** from Phabricator. Differential Revision: [D67712673](https://www.internalfb.com/diff/D67712673)
facebook-github-bot commented 2024-12-30 02:24:18 -08:00 (Migrated from github.com)

This pull request was exported from Phabricator. Differential Revision: D67712673

This pull request was **exported** from Phabricator. Differential Revision: [D67712673](https://www.internalfb.com/diff/D67712673)
facebook-github-bot commented 2024-12-30 02:51:13 -08:00 (Migrated from github.com)

This pull request was exported from Phabricator. Differential Revision: D67712673

This pull request was **exported** from Phabricator. Differential Revision: [D67712673](https://www.internalfb.com/diff/D67712673)
facebook-github-bot commented 2024-12-30 12:43:37 -08:00 (Migrated from github.com)

This pull request has been merged in facebook/yoga@9591210a7a.

This pull request has been merged in facebook/yoga@9591210a7ac5289fa00f15d5068383612d3225b9.

Pull request closed

Sign in to join this conversation.
No description provided.