Fix percentage in flexing parent
Summary: If we don't measure exactly, percentage values aren't exactly either. Fix for #414. Closes https://github.com/facebook/yoga/pull/416 Closes https://github.com/facebook/yoga/pull/414 Reviewed By: astreet Differential Revision: D4604729 Pulled By: emilsjolander fbshipit-source-id: 66880230073209cbe89668b838c2a82e7f9b34df
This commit is contained in:
parent
2030b6befe
commit
f52d66c311
|
@ -2045,7 +2045,7 @@ static void YGNodelayoutImpl(const YGNodeRef node,
|
|||
}
|
||||
|
||||
const bool flexBasisOverflows =
|
||||
measureModeMainDim == YGMeasureModeUndefined ? false : totalFlexBasis > availableInnerMainDim;
|
||||
measureModeMainDim == YGMeasureModeUndefined ? false : totalFlexBasis > availableInnerMainDim;
|
||||
if (isNodeFlexWrap && flexBasisOverflows && measureModeMainDim == YGMeasureModeAtMost) {
|
||||
measureModeMainDim = YGMeasureModeExactly;
|
||||
}
|
||||
|
@ -2338,8 +2338,12 @@ static void YGNodelayoutImpl(const YGNodeRef node,
|
|||
childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]],
|
||||
availableInnerCrossDim) +
|
||||
marginCross;
|
||||
childCrossMeasureMode =
|
||||
YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeExactly;
|
||||
const bool isLoosePercentageMeasurement =
|
||||
currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent &&
|
||||
measureModeCrossDim != YGMeasureModeExactly;
|
||||
childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement
|
||||
? YGMeasureModeUndefined
|
||||
: YGMeasureModeExactly;
|
||||
}
|
||||
|
||||
if (!YGFloatIsUndefined(currentRelativeChild->style.aspectRatio)) {
|
||||
|
|
Loading…
Reference in New Issue