From c3dc6a0f0e60c0a4a8be7723d82f7ea5feb03ef2 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Thu, 13 Apr 2017 09:51:45 -0700 Subject: [PATCH] Revert D4878875: [yoga][PR] Fix sizing of non strech items Differential Revision: D4878875 fbshipit-source-id: 8927438e7a1969deb617434369af53f71f625638 --- ReactCommon/yoga/yoga/Yoga.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ReactCommon/yoga/yoga/Yoga.c b/ReactCommon/yoga/yoga/Yoga.c index e8155ebe8..e70cb5f87 100644 --- a/ReactCommon/yoga/yoga/Yoga.c +++ b/ReactCommon/yoga/yoga/Yoga.c @@ -2189,7 +2189,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) { @@ -2200,14 +2199,11 @@ static void YGNodelayoutImpl(const YGNodeRef node, // If we don't have any children to flex or we can't flex the node itself, // space we've used is all space we need availableInnerMainDim = sizeConsumedOnCurrentLine; - sizeBasedOnContent = true; - } else { - sizeBasedOnContent = true; } } float remainingFreeSpace = 0; - if (!sizeBasedOnContent && !YGFloatIsUndefined(availableInnerMainDim)) { + if (!YGFloatIsUndefined(availableInnerMainDim)) { remainingFreeSpace = availableInnerMainDim - sizeConsumedOnCurrentLine; } else if (sizeConsumedOnCurrentLine < 0) { // availableInnerMainDim is indefinite which means the node is being sized