diff --git a/yoga/Yoga.c b/yoga/Yoga.c index cfd56be9..c24df508 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -2199,7 +2199,6 @@ static void YGNodelayoutImpl(const YGNodeRef node, // If the main dimension size isn't known, it is computed based on // the line length, so there's no more space left to distribute. - bool sizeBasedOnContent = false; // If we don't measure with exact main dimension we want to ensure we don't violate min and max if (measureModeMainDim != YGMeasureModeExactly) { if (!YGFloatIsUndefined(minInnerMainDim) && sizeConsumedOnCurrentLine < minInnerMainDim) { @@ -2212,21 +2211,16 @@ static void YGNodelayoutImpl(const YGNodeRef node, // space we've used is all space we need availableInnerMainDim = sizeConsumedOnCurrentLine; } - sizeBasedOnContent = true; } } float remainingFreeSpace = 0; - if ((!sizeBasedOnContent || node->config->useLegacyStretchBehaviour) && !YGFloatIsUndefined(availableInnerMainDim)) { + if (!YGFloatIsUndefined(availableInnerMainDim)) { remainingFreeSpace = availableInnerMainDim - sizeConsumedOnCurrentLine; } else if (sizeConsumedOnCurrentLine < 0) { - // availableInnerMainDim is indefinite which means the node is being sized - // based on its - // content. - // sizeConsumedOnCurrentLine is negative which means the node will - // allocate 0 points for - // its content. Consequently, remainingFreeSpace is 0 - - // sizeConsumedOnCurrentLine. + // availableInnerMainDim is indefinite which means the node is being sized based on its content. + // sizeConsumedOnCurrentLine is negative which means the node will allocate 0 points for + // its content. Consequently, remainingFreeSpace is 0 - sizeConsumedOnCurrentLine. remainingFreeSpace = -sizeConsumedOnCurrentLine; }