clipY property

bool clipY

Implementation

bool get clipY {
  RenderBoxModel renderBoxModel = this as RenderBoxModel;

  // Recycler layout not need repaintBoundary and scroll/pointer listeners,
  // ignoring overflowX or overflowY sets, which handle it self.
  if (renderBoxModel is RenderSliverListLayout) {
    return false;
  }

  List<Radius>? borderRadius = renderStyle.borderRadius;

  // The content of replaced elements is always trimmed to the content edge curve.
  // https://www.w3.org/TR/css-backgrounds-3/#corner-clipping
  if( borderRadius != null
    && this is RenderReplaced
    && renderStyle.intrinsicRatio != null
  ) {
    return true;
  }

  // Overflow value other than 'visible' always need to clip content.
  // https://www.w3.org/TR/css-overflow-3/#overflow-properties
  CSSOverflowType effectiveOverflowY = renderStyle.effectiveOverflowY;
  if (effectiveOverflowY != CSSOverflowType.visible) {
    Size scrollableSize = renderBoxModel.scrollableSize;
    Size scrollableViewportSize = renderBoxModel.scrollableViewportSize;
    // Border-radius always to clip inner content when overflow is not visible.
    if (scrollableSize.height > scrollableViewportSize.height
      || borderRadius != null
    ) {
      return true;
    }
  }
  return false;
}