Set width/height also to Undefined when we change the measure mode to Undefined

Summary:
Make sure width/height is always passed as Undefined when measure mode is changed to Undefined.

Changelog: [Internal][Yoga] Set width and height as Undefined when we change measure mode to Undefined

Reviewed By: alickbass

Differential Revision: D20029838

fbshipit-source-id: b9931f6ddb13ffd1565889535ade5bbffbe0c304
This commit is contained in:
Sidharth Guglani
2020-04-14 02:04:17 -07:00
committed by Facebook GitHub Bot
parent f7bc0ad248
commit e5743e851b

View File

@@ -1663,8 +1663,8 @@ static void YGNodeAbsoluteLayoutChild(
static void YGNodeWithMeasureFuncSetMeasuredDimensions( static void YGNodeWithMeasureFuncSetMeasuredDimensions(
const YGNodeRef node, const YGNodeRef node,
const float availableWidth, float availableWidth,
const float availableHeight, float availableHeight,
const YGMeasureMode widthMeasureMode, const YGMeasureMode widthMeasureMode,
const YGMeasureMode heightMeasureMode, const YGMeasureMode heightMeasureMode,
const float ownerWidth, const float ownerWidth,
@@ -1677,6 +1677,13 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
node->hasMeasureFunc(), node->hasMeasureFunc(),
"Expected node to have custom measure function"); "Expected node to have custom measure function");
if (widthMeasureMode == YGMeasureModeUndefined) {
availableWidth = YGUndefined;
}
if (heightMeasureMode == YGMeasureModeUndefined) {
availableHeight = YGUndefined;
}
const float paddingAndBorderAxisRow = const float paddingAndBorderAxisRow =
YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, ownerWidth); YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, ownerWidth);
const float paddingAndBorderAxisColumn = const float paddingAndBorderAxisColumn =