clipRRect method
void
clipRRect({})
Pushes a ClipRRectLayer to the compositing tree, calling paint
to
paint on top of the layer.
The bounds
argument defines the bounds in which the paint
should
paint, this is useful for debugging tools and does not affect rendering.
See also:
Implementation
void clipRRect({
required RRect rrect,
required VoidCallback paint,
Clip clipBehavior = Clip.antiAlias,
Offset offset = Offset.zero,
Rect? bounds,
LayerKey? key,
}) {
final offsetClipRRect = rrect.shift(offset + _render.paintOffset!);
ClipRRectLayer layer;
if (key?.layer is ClipRRectLayer) {
layer = (key!.layer! as ClipRRectLayer)
..clipRRect = offsetClipRRect
..clipBehavior = clipBehavior;
} else {
layer = ClipRRectLayer(
clipRRect: offsetClipRRect,
clipBehavior: clipBehavior,
);
key?.layer = layer;
}
push(layer: layer, paint: paint, offset: offset, bounds: bounds);
}