paintTransform method

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

Implementation

void paintTransform(PaintingContext context, Offset offset,
    PaintingContextCallback callback) {
  if (renderStyle.transformMatrix != null) {
    final Matrix4 transform = getEffectiveTransform();
    final Offset? childOffset = MatrixUtils.getAsTranslation(transform);
    if (childOffset == null) {
      _transformLayer.layer = context.pushTransform(
        needsCompositing,
        offset,
        transform,
        callback,
        oldLayer: _transformLayer.layer,
      );
    } else {
      callback(context, offset + childOffset);
      _transformLayer.layer = null;
    }
  } else {
    callback(context, offset);
  }
}