Correcting Flex fix within Experimental feature

Reviewed By: emilsjolander

Differential Revision: D4915189

fbshipit-source-id: efccee2fe39ed0f474a41dc3250d24c546f3f5d9
This commit is contained in:
Georgiy Kassabli 2017-04-19 13:27:03 -07:00 committed by Facebook Github Bot
parent bd0f9fbacb
commit 6b0c72fa82
1 changed files with 4 additions and 2 deletions

View File

@ -2203,9 +2203,11 @@ static void YGNodelayoutImpl(const YGNodeRef node,
availableInnerMainDim = minInnerMainDim;
} else if (!YGFloatIsUndefined(maxInnerMainDim) && sizeConsumedOnCurrentLine > maxInnerMainDim) {
availableInnerMainDim = maxInnerMainDim;
} else if (YGConfigIsExperimentalFeatureEnabled(node->config, YGExperimentalFeatureMinFlexFix)) {
} else if (YGConfigIsExperimentalFeatureEnabled(node->config, YGExperimentalFeatureMinFlexFix) &&
(totalFlexGrowFactors == 0 || YGResolveFlexGrow(node) == 0)) {
// TODO: this needs to be moved out of experimental feature, as this is legitimate fix
// If the measurement isn't exact, we want to use as little space as possible
// 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;
}
}