Skip to content

Fix TextMeasureCacheKey Hash Throwing Out Some LayoutConstraints#48525

Closed
NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman:export-D67922414
Closed

Fix TextMeasureCacheKey Hash Throwing Out Some LayoutConstraints#48525
NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman:export-D67922414

Conversation

@NickGerleman
Copy link
Contributor

Summary:
Fixes #48249

TextMeasureCacheKey hash and equality functions only incorporates the maximum width constraint. I'm guessing this was an attempt at an optimization, but it can lead to incorrect results in pretty trivial cases. E.g. if Yoga knows a definite size of Text in one dimension, and measures via YGMeasureModeExactly, we can have a minimum size corresponding specific to the style in which the text was laid out.

Changelog:
[General][Fixed] - Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints

Differential Revision: D67922414

Summary:
Fixes facebook#48249

`TextMeasureCacheKey` hash and equality functions only incorporates the maximum width constraint. I'm guessing this was an attempt at an optimization, but it can lead to incorrect results in pretty trivial cases. E.g. if Yoga knows a definite size of `Text` in one dimension,  and measures via `YGMeasureModeExactly`, we can have a minimum size corresponding specific to the style in which the text was laid out.

Changelog:
[General][Fixed] - Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints

Differential Revision: D67922414
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 8, 2025
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in f7a5db3.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @NickGerleman in f7a5db3

When will my fix make it into a release? | How to file a pick request?

cipolleschi pushed a commit that referenced this pull request Jan 9, 2025
Summary:
Pull Request resolved: #48525

Fixes #48249

`TextMeasureCacheKey` hash and equality functions only incorporates the maximum width constraint. I'm guessing this was an attempt at an optimization, but it can lead to incorrect results in pretty trivial cases. E.g. if Yoga knows a definite size of `Text` in one dimension,  and measures via `YGMeasureModeExactly`, we can have a minimum size corresponding specific to the style in which the text was laid out.

Changelog:
[General][Fixed] - Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints

Reviewed By: christophpurrer

Differential Revision: D67922414

fbshipit-source-id: 0ee0220059fc4e4645b1684c42a0587fe728bedd
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @NickGerleman in 342e3ec

When will my fix make it into a release? | How to file a pick request?

robhogan pushed a commit that referenced this pull request Jan 15, 2025
Summary:
Pull Request resolved: #48525

Fixes #48249

`TextMeasureCacheKey` hash and equality functions only incorporates the maximum width constraint. I'm guessing this was an attempt at an optimization, but it can lead to incorrect results in pretty trivial cases. E.g. if Yoga knows a definite size of `Text` in one dimension,  and measures via `YGMeasureModeExactly`, we can have a minimum size corresponding specific to the style in which the text was laid out.

Changelog:
[General][Fixed] - Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints

Reviewed By: christophpurrer

Differential Revision: D67922414

fbshipit-source-id: 0ee0220059fc4e4645b1684c42a0587fe728bedd
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @NickGerleman in e7db7a7

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android][NewArch] Weird layout styling if multiple instances of the same component with the same props

3 participants