Skip to content

Commit

Permalink
Correct fix for flexing grandchildren
Browse files Browse the repository at this point in the history
Reviewed By: emilsjolander

Differential Revision: D4875343

fbshipit-source-id: 634e961f9798dff43eae2c6564b28c6629b816e0
  • Loading branch information
Georgiy Kassabli authored and Maxime Aoustin committed Apr 19, 2017
1 parent 833ef42 commit 6cb1979
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions ReactCommon/yoga/yoga/YGEnums.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/yoga/yoga/YGEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 3 additions & 4 deletions ReactCommon/yoga/yoga/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ static YGConfig gYGConfigDefaults = {
.experimentalFeatures =
{
[YGExperimentalFeatureRounding] = false,
[YGExperimentalFeatureMinFlexFix] = false,
[YGExperimentalFeatureWebFlexBasis] = false,
},
.useWebDefaults = false,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6cb1979

Please sign in to comment.