Fix justify content + min dimension usage in root
Reviewed By: gkassabli, lucasr Differential Revision: D4021443 fbshipit-source-id: 00f58c6078ac3076221e1148aacc34712786deb5
This commit is contained in:
parent
c84157a8ad
commit
d376155e2c
|
@ -1514,10 +1514,14 @@ static void layoutNodeImpl(const CSSNodeRef node,
|
||||||
// that are aligned "stretch". We need to compute these stretch values and
|
// that are aligned "stretch". We need to compute these stretch values and
|
||||||
// set the final positions.
|
// set the final positions.
|
||||||
|
|
||||||
// If we are using "at most" rules in the main axis, we won't distribute
|
// If we are using "at most" rules in the main axis. Calculate the remaining space when
|
||||||
// any remaining space at this point.
|
// constraint by the min size defined for the main axis.
|
||||||
if (measureModeMainDim == CSSMeasureModeAtMost) {
|
if (measureModeMainDim == CSSMeasureModeAtMost) {
|
||||||
remainingFreeSpace = 0;
|
if (!CSSValueIsUndefined(node->style.minDimensions[dim[mainAxis]]) && node->style.minDimensions[dim[mainAxis]] >= 0) {
|
||||||
|
remainingFreeSpace = fmaxf(0, node->style.minDimensions[dim[mainAxis]] - (availableInnerMainDim - remainingFreeSpace));
|
||||||
|
} else {
|
||||||
|
remainingFreeSpace = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (justifyContent) {
|
switch (justifyContent) {
|
||||||
|
|
Loading…
Reference in New Issue