Correct fix for flexing grandchildren

Reviewed By: emilsjolander

Differential Revision: D4875343

fbshipit-source-id: 634e961f9798dff43eae2c6564b28c6629b816e0
This commit is contained in:
Georgiy Kassabli 2017-04-13 08:38:02 -07:00 committed by Facebook Github Bot
parent a82de9509f
commit 831ad4adc6
3 changed files with 3 additions and 7 deletions

View File

@ -93,8 +93,6 @@ const char *YGExperimentalFeatureToString(const YGExperimentalFeature value){
return "rounding";
case YGExperimentalFeatureWebFlexBasis:
return "web-flex-basis";
case YGExperimentalFeatureMinFlexFix:
return "min-flex-fix";
}
return "unknown";
}

View File

@ -66,7 +66,6 @@ WIN_EXPORT const char *YGEdgeToString(const YGEdge value);
typedef YG_ENUM_BEGIN(YGExperimentalFeature) {
YGExperimentalFeatureRounding,
YGExperimentalFeatureWebFlexBasis,
YGExperimentalFeatureMinFlexFix,
} YG_ENUM_END(YGExperimentalFeature);
WIN_EXPORT const char *YGExperimentalFeatureToString(const YGExperimentalFeature value);

View File

@ -203,7 +203,6 @@ static YGConfig gYGConfigDefaults = {
.experimentalFeatures =
{
[YGExperimentalFeatureRounding] = false,
[YGExperimentalFeatureMinFlexFix] = false,
[YGExperimentalFeatureWebFlexBasis] = false,
},
.useWebDefaults = false,
@ -2204,9 +2203,9 @@ static void YGNodelayoutImpl(const YGNodeRef node,
availableInnerMainDim = minInnerMainDim;
} else if (!YGFloatIsUndefined(maxInnerMainDim) && sizeConsumedOnCurrentLine > maxInnerMainDim) {
availableInnerMainDim = maxInnerMainDim;
} else if (YGConfigIsExperimentalFeatureEnabled(node->config, YGExperimentalFeatureMinFlexFix)) {
// 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
} else if (totalFlexGrowFactors == 0 || YGResolveFlexGrow(node) == 0) {
// 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 {