Skip to content

Correctly size cross axis when measuring flex basis#199

Merged
emilsjolander merged 1 commit into
react:masterfrom
emilsjolander:measure-fix
Jul 8, 2016
Merged

Correctly size cross axis when measuring flex basis#199
emilsjolander merged 1 commit into
react:masterfrom
emilsjolander:measure-fix

Conversation

@emilsjolander

Copy link
Copy Markdown
Contributor
  • Nodes were measured with the assumption of being text nodes (height depends on width) when determining flex basis. This is not always true. Even when we are just interested in the main axis (flex basis) we need to correctly constrain the cross axis.
  • Some tests were wrong. Measuring texts.big and expecting it to have textSizes.smallHeight which doesn't make a lot of sense.

@ghost ghost added the CLA Signed label Jun 29, 2016
@rigdern

rigdern commented Jul 6, 2016

Copy link
Copy Markdown

Some tests were wrong. Measuring texts.big and expecting it to have textSizes.smallHeight which doesn't make a lot of sense.

In the context of texts.big, I think that smallHeight means that the text fits on one line whereas bigHeight means that the text wrapped and takes up multiple lines.

@emilsjolander

Copy link
Copy Markdown
Contributor Author

@rigdern Interesting, I had not thought of that. Super confusing. With that in mind i'll have another look. thanks

@emilsjolander emilsjolander merged commit 8b7f353 into react:master Jul 8, 2016
@emilsjolander emilsjolander deleted the measure-fix branch July 8, 2016 15:47
ghost pushed a commit to react/react-native that referenced this pull request Jul 8, 2016
Summary:
react/yoga#199

- Nodes were measured with the assumption of being text nodes (height depends on width) when determining flex basis. This is not always true. Even when we are just interested in the main axis (flex basis) we need to correctly constrain the cross axis.
- Some tests were wrong. Measuring texts.big and expecting it to have textSizes.smallHeight which doesn't make a lot of sense.

Reviewed By: vjeux

Differential Revision: D3510163

fbshipit-source-id: ee53b548dd078005fdd153d279e4c7fef3dd02d0
tungdo194 pushed a commit to tungdo194/rn-test that referenced this pull request Apr 28, 2024
Summary:
react/yoga#199

- Nodes were measured with the assumption of being text nodes (height depends on width) when determining flex basis. This is not always true. Even when we are just interested in the main axis (flex basis) we need to correctly constrain the cross axis.
- Some tests were wrong. Measuring texts.big and expecting it to have textSizes.smallHeight which doesn't make a lot of sense.

Reviewed By: vjeux

Differential Revision: D3510163

fbshipit-source-id: ee53b548dd078005fdd153d279e4c7fef3dd02d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants