default root node to size of parent contraints
Summary: This is a follow up on a recent change which made the constraints passed into conculateLayout describe the parent constraints and not the root node constraints. This broke some assumptions and was not very inuitive if no size was set on the root. Therefor this diff ensure that if the root node does not have any size set then it will adopt the size of the parent constraints. Reviewed By: dshahidehpour Differential Revision: D4634616 fbshipit-source-id: 089eb4313c5bb810a6ff56f158cd19cec71808ec
This commit is contained in:
committed by
Facebook Github Bot
parent
b523402eda
commit
785713c9c0
@@ -3307,6 +3307,9 @@ void YGNodeCalculateLayout(const YGNodeRef node,
|
|||||||
} else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) {
|
} else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) {
|
||||||
width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth);
|
width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth);
|
||||||
widthMeasureMode = YGMeasureModeAtMost;
|
widthMeasureMode = YGMeasureModeAtMost;
|
||||||
|
} else {
|
||||||
|
width = parentWidth;
|
||||||
|
widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined : YGMeasureModeExactly;
|
||||||
}
|
}
|
||||||
|
|
||||||
float height = YGUndefined;
|
float height = YGUndefined;
|
||||||
@@ -3319,6 +3322,9 @@ void YGNodeCalculateLayout(const YGNodeRef node,
|
|||||||
0.0f) {
|
0.0f) {
|
||||||
height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight);
|
height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight);
|
||||||
heightMeasureMode = YGMeasureModeAtMost;
|
heightMeasureMode = YGMeasureModeAtMost;
|
||||||
|
} else {
|
||||||
|
height = parentHeight;
|
||||||
|
heightMeasureMode = YGFloatIsUndefined(height) ? YGMeasureModeUndefined : YGMeasureModeExactly;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (YGLayoutNodeInternal(node,
|
if (YGLayoutNodeInternal(node,
|
||||||
|
Reference in New Issue
Block a user