@@ -2520,19 +2520,22 @@ static void YGNodelayoutImpl(const YGNodeRef node,
25202520
25212521 // If the user didn't specify a width or height for the node, set the
25222522 // dimensions based on the children.
2523- if (measureModeMainDim == YGMeasureModeUndefined ) {
2523+ if (measureModeMainDim == YGMeasureModeUndefined ||
2524+ (node -> style .overflow != YGOverflowScroll && measureModeMainDim == YGMeasureModeAtMost )) {
25242525 // Clamp the size to the min/max size, if specified, and make sure it
25252526 // doesn't go below the padding and border amount.
25262527 node -> layout .measuredDimensions [dim [mainAxis ]] =
25272528 YGNodeBoundAxis (node , mainAxis , maxLineMainDim , mainAxisParentSize , parentWidth );
2528- } else if (measureModeMainDim == YGMeasureModeAtMost ) {
2529+ } else if (measureModeMainDim == YGMeasureModeAtMost &&
2530+ node -> style .overflow == YGOverflowScroll ) {
25292531 node -> layout .measuredDimensions [dim [mainAxis ]] = fmaxf (
25302532 fminf (availableInnerMainDim + paddingAndBorderAxisMain ,
25312533 YGNodeBoundAxisWithinMinAndMax (node , mainAxis , maxLineMainDim , mainAxisParentSize )),
25322534 paddingAndBorderAxisMain );
25332535 }
25342536
2535- if (measureModeCrossDim == YGMeasureModeUndefined ) {
2537+ if (measureModeCrossDim == YGMeasureModeUndefined ||
2538+ (node -> style .overflow != YGOverflowScroll && measureModeCrossDim == YGMeasureModeAtMost )) {
25362539 // Clamp the size to the min/max size, if specified, and make sure it
25372540 // doesn't go below the padding and border amount.
25382541 node -> layout .measuredDimensions [dim [crossAxis ]] =
@@ -2541,7 +2544,8 @@ static void YGNodelayoutImpl(const YGNodeRef node,
25412544 totalLineCrossDim + paddingAndBorderAxisCross ,
25422545 crossAxisParentSize ,
25432546 parentWidth );
2544- } else if (measureModeCrossDim == YGMeasureModeAtMost ) {
2547+ } else if (measureModeCrossDim == YGMeasureModeAtMost &&
2548+ node -> style .overflow == YGOverflowScroll ) {
25452549 node -> layout .measuredDimensions [dim [crossAxis ]] =
25462550 fmaxf (fminf (availableInnerCrossDim + paddingAndBorderAxisCross ,
25472551 YGNodeBoundAxisWithinMinAndMax (node ,
0 commit comments