Include margin when calculating if children overflow
Reviewed By: passy Differential Revision: D5044471 fbshipit-source-id: e7c1eb694445ffb898bcf375d9deefc558c49f11
This commit is contained in:
parent
54548894d0
commit
67b96fc0ce
|
@ -2109,7 +2109,7 @@ static void YGNodelayoutImpl(const YGNodeRef node,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float totalFlexBasis = 0;
|
float totalOuterFlexBasis = 0;
|
||||||
|
|
||||||
// STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM
|
// STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM
|
||||||
for (uint32_t i = 0; i < childCount; i++) {
|
for (uint32_t i = 0; i < childCount; i++) {
|
||||||
|
@ -2162,11 +2162,14 @@ static void YGNodelayoutImpl(const YGNodeRef node,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
totalFlexBasis += child->layout.computedFlexBasis;
|
totalOuterFlexBasis +=
|
||||||
|
child->layout.computedFlexBasis + YGNodeMarginForAxis(child, mainAxis, availableInnerWidth);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool flexBasisOverflows =
|
const bool flexBasisOverflows = measureModeMainDim == YGMeasureModeUndefined
|
||||||
measureModeMainDim == YGMeasureModeUndefined ? false : totalFlexBasis > availableInnerMainDim;
|
? false
|
||||||
|
: totalOuterFlexBasis > availableInnerMainDim;
|
||||||
if (isNodeFlexWrap && flexBasisOverflows && measureModeMainDim == YGMeasureModeAtMost) {
|
if (isNodeFlexWrap && flexBasisOverflows && measureModeMainDim == YGMeasureModeAtMost) {
|
||||||
measureModeMainDim = YGMeasureModeExactly;
|
measureModeMainDim = YGMeasureModeExactly;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue