describeApproximatePaintClip method

  1. @override
Rect describeApproximatePaintClip (
  1. covariant RenderObject child
)
override

Returns a rect in this object's coordinate system that describes the approximate bounding box of the clip rect that would be applied to the given child during the paint phase, if any.

Returns null if the child would not be clipped.

This is used in the semantics phase to avoid including children that are not physically visible.

Implementation

@override
Rect describeApproximatePaintClip(RenderObject child) {
  if (child != null && _shouldClipAtCurrentOffset()) {
    return Offset.zero & size;
  }
  return null;
}