Measure nodes which have margin: auto and align-item: stretch #645
Reference in New Issue
Block a user
No description provided.
Delete Branch "margin_auto_measure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If you have a measurable node and set
marign-left: auto
+align-item:stretch
on it, it won't get measured and they get a width/height of-(nan)
. This change fixes that behaviour. Fixes #644.@woehrl01 Can you ensure we have a test case to catch the case where we have auto + stretch without a custom measure? Both when node has explicit and non-explcit size set.
If I remember correctly we already have that in place for non custom measure nodes. This change is only needed for custom measure nodes. I added those when I initially added the auto margin support.
I can't find any test in https://github.com/facebook/yoga/blob/master/tests/YGMarginTest.cpp which sets auto margin without defined width/height (thus relying on stretch behaviour). Could you add one?
Sure 👍 I'll have a look in the next couple of hours. I'm currently out of office.
👍
@emilsjolander I hope these are the kind of tests you are looking for. 🔬
Looks good!
@emilsjolander is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Pull request closed