Fix measure inner dimensions #1114

Closed
kinarobin wants to merge 3 commits from fix-flex-inner-main-dimension-measure into main

View File

@@ -2952,10 +2952,10 @@ static void YGNodelayoutImpl(
availableInnerMainDim = maxInnerMainDim;
} else {
rshest commented 2022-10-07 10:48:02 -07:00 (Migrated from github.com)
Review

Guess those extra parentheses are redundant, now that it's a list of OR clauses... granted, the expression is quite hard to unpack visually, and extra parentheses don't help here, quite an opposite

Guess those extra parentheses are redundant, now that it's a list of OR clauses... granted, the expression is quite hard to unpack visually, and extra parentheses don't help here, quite an opposite
rshest commented 2022-10-07 13:27:32 -07:00 (Migrated from github.com)
Review

I actually believe that the original intent there may have been to have it like this instead:

if (!node->getConfig()->useLegacyStretchBehaviour &&
            ((!YGFloatIsUndefined(
                  collectedFlexItemsValues.totalFlexGrowFactors) &&
              collectedFlexItemsValues.totalFlexGrowFactors == 0) ||
             (!YGFloatIsUndefined(node->resolveFlexGrow()) &&
              node->resolveFlexGrow() == 0))) {
I actually believe that the original intent there may have been to have it like this instead: ```c++ if (!node->getConfig()->useLegacyStretchBehaviour && ((!YGFloatIsUndefined( collectedFlexItemsValues.totalFlexGrowFactors) && collectedFlexItemsValues.totalFlexGrowFactors == 0) || (!YGFloatIsUndefined(node->resolveFlexGrow()) && node->resolveFlexGrow() == 0))) { ```
kinarobin commented 2022-10-07 20:39:57 -07:00 (Migrated from github.com)
Review

Yeah, you're right. I had update this code.

Yeah, you're right. I had update this code.
if (!node->getConfig()->useLegacyStretchBehaviour &&
((YGFloatIsUndefined(
((!YGFloatIsUndefined(
collectedFlexItemsValues.totalFlexGrowFactors) &&
collectedFlexItemsValues.totalFlexGrowFactors == 0) ||
(YGFloatIsUndefined(node->resolveFlexGrow()) &&
(!YGFloatIsUndefined(node->resolveFlexGrow()) &&
node->resolveFlexGrow() == 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. Root node also