@@ -470,23 +470,6 @@ float YGNodeStyleGetFlexShrink(const YGNodeRef node) {
470
470
: node->getStyle ().flexShrink ;
471
471
}
472
472
473
- static inline float YGNodeResolveFlexShrink (const YGNodeRef node) {
474
- // Root nodes flexShrink should always be 0
475
- if (node->getParent () == nullptr ) {
476
- return 0.0 ;
477
- }
478
- if (!YGFloatIsUndefined (node->getStyle ().flexShrink )) {
479
- return node->getStyle ().flexShrink ;
480
- }
481
- if (!node->getConfig ()->useWebDefaults &&
482
- !YGFloatIsUndefined (node->getStyle ().flex ) &&
483
- node->getStyle ().flex < 0 .0f ) {
484
- return -node->getStyle ().flex ;
485
- }
486
- return node->getConfig ()->useWebDefaults ? kWebDefaultFlexShrink
487
- : kDefaultFlexShrink ;
488
- }
489
-
490
473
#define YG_NODE_STYLE_PROPERTY_SETTER_IMPL ( \
491
474
type, name, paramName, instanceName) \
492
475
void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) { \
@@ -1021,7 +1004,7 @@ static YGFlexDirection YGFlexDirectionCross(const YGFlexDirection flexDirection,
1021
1004
static inline bool YGNodeIsFlex (const YGNodeRef node) {
1022
1005
return (
1023
1006
node->getStyle ().positionType == YGPositionTypeRelative &&
1024
- (node->resolveFlexGrow () != 0 || YGNodeResolveFlexShrink ( node) != 0 ));
1007
+ (node->resolveFlexGrow () != 0 || node-> resolveFlexShrink ( ) != 0 ));
1025
1008
}
1026
1009
1027
1010
static bool YGIsBaselineLayout (const YGNodeRef node) {
@@ -2028,7 +2011,7 @@ static void YGNodelayoutImpl(const YGNodeRef node,
2028
2011
}
2029
2012
} else if (
2030
2013
child->resolveFlexGrow () > 0 .0f &&
2031
- YGNodeResolveFlexShrink ( child) > 0 .0f ) {
2014
+ child-> resolveFlexShrink ( ) > 0 .0f ) {
2032
2015
singleFlexChild = child;
2033
2016
}
2034
2017
}
@@ -2176,7 +2159,7 @@ static void YGNodelayoutImpl(const YGNodeRef node,
2176
2159
totalFlexGrowFactors += child->resolveFlexGrow ();
2177
2160
2178
2161
// Unlike the grow factor, the shrink factor is scaled relative to the child dimension.
2179
- totalFlexShrinkScaledFactors += -YGNodeResolveFlexShrink ( child) *
2162
+ totalFlexShrinkScaledFactors += -child-> resolveFlexShrink ( ) *
2180
2163
child->getLayout ().computedFlexBasis ;
2181
2164
}
2182
2165
@@ -2296,7 +2279,8 @@ static void YGNodelayoutImpl(const YGNodeRef node,
2296
2279
currentRelativeChild->getLayout ().computedFlexBasis ));
2297
2280
2298
2281
if (remainingFreeSpace < 0 ) {
2299
- flexShrinkScaledFactor = -YGNodeResolveFlexShrink (currentRelativeChild) * childFlexBasis;
2282
+ flexShrinkScaledFactor =
2283
+ -currentRelativeChild->resolveFlexShrink () * childFlexBasis;
2300
2284
2301
2285
// Is this child able to shrink?
2302
2286
if (flexShrinkScaledFactor != 0 ) {
@@ -2369,7 +2353,8 @@ static void YGNodelayoutImpl(const YGNodeRef node,
2369
2353
float updatedMainSize = childFlexBasis;
2370
2354
2371
2355
if (remainingFreeSpace < 0 ) {
2372
- flexShrinkScaledFactor = -YGNodeResolveFlexShrink (currentRelativeChild) * childFlexBasis;
2356
+ flexShrinkScaledFactor =
2357
+ -currentRelativeChild->resolveFlexShrink () * childFlexBasis;
2373
2358
// Is this child able to shrink?
2374
2359
if (flexShrinkScaledFactor != 0 ) {
2375
2360
float childSize;
0 commit comments