-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sizing of non strech items #506
Conversation
@@ -2197,6 +2197,7 @@ static void YGNodelayoutImpl(const YGNodeRef node, | |||
// If the main dimension size isn't known, it is computed based on | |||
// the line length, so there's no more space left to distribute. | |||
|
|||
bool sizeBasedOnContent = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bool sizeBasedOnContent = measureModeMainDim != YGMeasureModeExactly
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also enable moving this bool to right above the if statement it is used in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just remove the boolean all together and inline measureModeMainDim == YGMeasureModeExactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for the min and max case we shouldn't take the content into account. That's why it isn't const/inlined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry. :/ It's been a long day, totally missed that. This looks good!
@emilsjolander has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. See facebook/yoga#505 Closes facebook/yoga#506 Differential Revision: D4878875 Pulled By: emilsjolander fbshipit-source-id: ab1174ac7a76dcf20aae7b29a3bc396e11077c4d
Re-opening this as we need to revert it due to some breakages. I'll look into it further in a couple days. Thanks for the work! |
👍 |
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. See facebook/yoga#505 Closes facebook/yoga#506 Differential Revision: D4878875 Pulled By: emilsjolander fbshipit-source-id: ab1174ac7a76dcf20aae7b29a3bc396e11077c4d
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking. See facebook/yoga#505 Closes facebook/yoga#506 Reviewed By: astreet Differential Revision: D4954016 Pulled By: emilsjolander fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking. See #505 Closes #506 Reviewed By: astreet Differential Revision: D4954016 Pulled By: emilsjolander fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. See facebook/yoga#505 Closes facebook/yoga#506 Differential Revision: D4878875 Pulled By: emilsjolander fbshipit-source-id: ab1174ac7a76dcf20aae7b29a3bc396e11077c4d
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking. See facebook/yoga#505 Closes facebook/yoga#506 Reviewed By: astreet Differential Revision: D4954016 Pulled By: emilsjolander fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. See facebook/yoga#505 Closes facebook/yoga#506 Differential Revision: D4878875 Pulled By: emilsjolander fbshipit-source-id: ab1174ac7a76dcf20aae7b29a3bc396e11077c4d
Summary: Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking. See facebook/yoga#505 Closes facebook/yoga#506 Reviewed By: astreet Differential Revision: D4954016 Pulled By: emilsjolander fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7
Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. See #505 and #504.