Revert D5874862: [yoga][PR] Fix shrinking in non strech alignments

Differential Revision: D5874862

fbshipit-source-id: 24517d26b18c11fb9f75c6d3b5faae360711ea9e
This commit is contained in:
Emil Sjolander 2017-09-21 03:36:02 -07:00 committed by Facebook Github Bot
parent 26133beda9
commit 244045edea

View File

@ -2308,7 +2308,6 @@ static void YGNodelayoutImpl(const YGNodeRef node,
// If the main dimension size isn't known, it is computed based on // 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. // 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 we don't measure with exact main dimension we want to ensure we don't violate min and max
if (measureModeMainDim != YGMeasureModeExactly) { if (measureModeMainDim != YGMeasureModeExactly) {
if (!YGFloatIsUndefined(minInnerMainDim) && sizeConsumedOnCurrentLine < minInnerMainDim) { if (!YGFloatIsUndefined(minInnerMainDim) && sizeConsumedOnCurrentLine < minInnerMainDim) {
@ -2323,12 +2322,11 @@ static void YGNodelayoutImpl(const YGNodeRef node,
// space we've used is all space we need. Root node also should be shrunk to minimum // space we've used is all space we need. Root node also should be shrunk to minimum
availableInnerMainDim = sizeConsumedOnCurrentLine; availableInnerMainDim = sizeConsumedOnCurrentLine;
} }
sizeBasedOnContent = true;
} }
} }
float remainingFreeSpace = 0; float remainingFreeSpace = 0;
if (!sizeBasedOnContent && !YGFloatIsUndefined(availableInnerMainDim)) { if (!YGFloatIsUndefined(availableInnerMainDim)) {
remainingFreeSpace = availableInnerMainDim - sizeConsumedOnCurrentLine; remainingFreeSpace = availableInnerMainDim - sizeConsumedOnCurrentLine;
} else if (sizeConsumedOnCurrentLine < 0) { } else if (sizeConsumedOnCurrentLine < 0) {
// availableInnerMainDim is indefinite which means the node is being sized based on its // availableInnerMainDim is indefinite which means the node is being sized based on its