paintOpacity method

void paintOpacity(
  1. PaintingContext context,
  2. Offset offset,
  3. PaintingContextCallback callback
)

Implementation

void paintOpacity(PaintingContext context, Offset offset,
    PaintingContextCallback callback) {

  if (alpha == 255) {
    _opacityLayer.layer = null;
    // No need to keep the layer. We'll create a new one if necessary.
    callback(context, offset);
    return;
  }

  _opacityLayer.layer =
      context.pushOpacity(offset, alpha, callback, oldLayer: _opacityLayer.layer);
}