Expose Unsnapped Dimensions #1809

Closed
NickGerleman wants to merge 1 commits from export-D74292949 into main
NickGerleman commented 2025-05-08 16:16:10 -07:00 (Migrated from github.com)

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

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: rshest

Differential Revision: D74292949

Summary: X-link: https://github.com/facebook/react-native/pull/51181 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: rshest Differential Revision: D74292949
vercel[bot] commented 2025-05-08 16:16:14 -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 8, 2025 11:18pm
[vc]: #kr+BzcqBQCtRMo61JBi0YOJomXw9BmzVdgZOTZMTmT0=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ5b2dhLXdlYnNpdGUiLCJyb290RGlyZWN0b3J5Ijoid2Vic2l0ZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9mYm9wZW5zb3VyY2UveW9nYS13ZWJzaXRlL0N2Y2pIOEZRRXpodXNSRnVyNEdzNlR2SDNZaUciLCJwcmV2aWV3VXJsIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLW5pY2tnZXJsZW1hbi1leHBvcnQtZC01OTRiMTQtZmJvcGVuc291cmNlLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLW5pY2tnZXJsZW1hbi1leHBvcnQtZC01OTRiMTQtZmJvcGVuc291cmNlLnZlcmNlbC5hcHAifX1dfQ== **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/CvcjH8FQEzhusRFur4Gs6TvH3YiG)) | [Visit Preview](https://yoga-website-git-fork-nickgerleman-export-d-594b14-fbopensource.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/yoga-website-git-fork-nickgerleman-export-d-594b14-fbopensource.vercel.app?via=pr-comment-feedback-link) | May 8, 2025 11:18pm |
facebook-github-bot commented 2025-05-08 16:16:19 -07:00 (Migrated from github.com)

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

This pull request was **exported** from Phabricator. Differential Revision: [D74292949](https://www.internalfb.com/diff/D74292949)
facebook-github-bot commented 2025-05-08 17:48:10 -07:00 (Migrated from github.com)

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

This pull request has been merged in facebook/yoga@37a94a86de75845b4ad301d742dd68b1f5fa8bbb.
facebook-github-bot commented 2025-05-09 01:48:01 -07:00 (Migrated from github.com)

This pull request has been reverted by 624325302c.

This pull request has been **reverted** by 624325302ca976f787158b709e16e7495b8575fe.

Pull request closed

Sign in to join this conversation.
No description provided.