clipRectAndPaint method

void clipRectAndPaint (Rect rect, Clip clipBehavior, Rect bounds, void painter())

Clip canvas with Path according to Rect and then paint. canvas is restored to the pre-clip status afterwards.

bounds is the saveLayer bounds used for Clip.antiAliasWithSaveLayer.

Implementation

void clipRectAndPaint(Rect rect, Clip clipBehavior, Rect bounds, void painter()) {
  _clipAndPaint((bool doAntiAias) => canvas.clipRect(rect, doAntiAlias: doAntiAias), clipBehavior, bounds, painter);
}