Fix min/max percentage constraints on measured nodes

Summary:
Fix min/max percentage constraints on measured nodes. Currently we passed in the available size instead of the parent size.
Fixes #611
Closes https://github.com/facebook/yoga/pull/649

Reviewed By: priteshrnandgaonkar

Differential Revision: D6408019

Pulled By: emilsjolander

fbshipit-source-id: 18be5056dbc0dc179970ec231ab8b4e2cdba65c5
This commit is contained in:
Lukas Wöhrl 2017-11-30 07:47:38 -08:00 committed by Facebook Github Bot
parent 71b498b082
commit 4fdaf2de98
1 changed files with 4 additions and 4 deletions

View File

@ -1592,8 +1592,8 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(const YGNodeRef node,
widthMeasureMode == YGMeasureModeAtMost) widthMeasureMode == YGMeasureModeAtMost)
? measuredSize.width + paddingAndBorderAxisRow ? measuredSize.width + paddingAndBorderAxisRow
: availableWidth - marginAxisRow, : availableWidth - marginAxisRow,
availableWidth, parentWidth,
availableWidth); parentWidth);
node->layout.measuredDimensions[YGDimensionHeight] = node->layout.measuredDimensions[YGDimensionHeight] =
YGNodeBoundAxis(node, YGNodeBoundAxis(node,
YGFlexDirectionColumn, YGFlexDirectionColumn,
@ -1601,8 +1601,8 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(const YGNodeRef node,
heightMeasureMode == YGMeasureModeAtMost) heightMeasureMode == YGMeasureModeAtMost)
? measuredSize.height + paddingAndBorderAxisColumn ? measuredSize.height + paddingAndBorderAxisColumn
: availableHeight - marginAxisColumn, : availableHeight - marginAxisColumn,
availableHeight, parentHeight,
availableWidth); parentWidth);
} }
} }