actualPaintBounds property

Rect? get actualPaintBounds

The actual bounds used for clipping content during painting.

Returns the rectangle that defines the clipping region based on overflow settings. Returns null if no clipping should occur. This takes into account both horizontal and vertical overflow settings.

Implementation

Rect? get actualPaintBounds {
  bool clipHorizontal = horizontalOverflow.clipContent;
  bool clipVertical = verticalOverflow.clipContent;
  if (!clipHorizontal && !clipVertical) {
    return null;
  }
  Rect contentBounds = this.contentBounds;
  return Rect.fromLTWH(
    clipHorizontal ? 0.0 : contentBounds.left,
    clipVertical ? 0.0 : contentBounds.top,
    clipHorizontal ? size.width : contentBounds.width,
    clipVertical ? size.height : contentBounds.height,
  );
}