Resubmit: Expose Unsnapped Dimensions #1811

Closed
NickGerleman wants to merge 1 commits from export-D74673119 into main
NickGerleman commented 2025-05-13 15:52:59 -07:00 (Migrated from github.com)

Summary:
X-link: https://github.com/facebook/react-native/pull/51298

Resubmit

This was backed out due to being up the stack from another change that was backed out, but should be safe by itself.

Original

We want to know if an artifact created during measurement can fully be reused after final layout, but the final layout is allowed to be slightly larger due to pixel grid rounding (while still allowing reuse). It's hard to tell after the fact, whether it is larger because of this rounding (though the measure is used), or if it may be a pixel larger for valid reasons.

We can expose the unsnapped dimensions of a node to give us this information, and to correlate measurement artifacts.

This is most of the time the same as the layout's measured dimension, though I don't think it's safe to use this, since anything else measuring the node after could clobber this (I think YGNodeLayoutGetOverflow may also be prone to this as a bug).

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74673119

Summary: X-link: https://github.com/facebook/react-native/pull/51298 ## Resubmit This was backed out due to being up the stack from another change that was backed out, but should be safe by itself. ## Original We want to know if an artifact created during measurement can fully be reused after final layout, but the final layout is allowed to be slightly larger due to pixel grid rounding (while still allowing reuse). It's hard to tell after the fact, whether it is larger because of this rounding (though the measure is used), or if it may be a pixel larger for valid reasons. We can expose the unsnapped dimensions of a node to give us this information, and to correlate measurement artifacts. This is most of the time the same as the layout's measured dimension, though I don't think it's safe to use this, since anything else measuring the node after could clobber this (I think `YGNodeLayoutGetOverflow` may also be prone to this as a bug). Changelog: [Internal] Reviewed By: joevilches Differential Revision: D74673119
vercel[bot] commented 2025-05-13 15:53:04 -07: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 May 13, 2025 10:55pm
[vc]: #JN3VZsqqlJJNzw7x/IGCOIUXF4koUgVD6wUbboYF070=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ5b2dhLXdlYnNpdGUiLCJyb290RGlyZWN0b3J5Ijoid2Vic2l0ZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9mYm9wZW5zb3VyY2UveW9nYS13ZWJzaXRlL1kyRVZMdWNoaXVuR2pLUFUxdUs1QWt2dXRTQmoiLCJwcmV2aWV3VXJsIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLW5pY2tnZXJsZW1hbi1leHBvcnQtZC03MWRmMmMtZmJvcGVuc291cmNlLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLW5pY2tnZXJsZW1hbi1leHBvcnQtZC03MWRmMmMtZmJvcGVuc291cmNlLnZlcmNlbC5hcHAifX1dfQ== **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/Y2EVLuchiunGjKPU1uK5AkvutSBj)) | [Visit Preview](https://yoga-website-git-fork-nickgerleman-export-d-71df2c-fbopensource.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/yoga-website-git-fork-nickgerleman-export-d-71df2c-fbopensource.vercel.app?via=pr-comment-feedback-link) | May 13, 2025 10:55pm |
facebook-github-bot commented 2025-05-13 15:53:07 -07:00 (Migrated from github.com)

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

This pull request was **exported** from Phabricator. Differential Revision: [D74673119](https://www.internalfb.com/diff/D74673119)
facebook-github-bot commented 2025-05-13 18:24:09 -07:00 (Migrated from github.com)

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

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

Pull request closed

Sign in to join this conversation.
No description provided.