paintShape method

  1. @override
void paintShape(
  1. PdfGraphics canvas
)
override

Implementation

@override
void paintShape(PdfGraphics canvas) {
  if (image == null) {
    return;
  }

  final sx = width / image!.width;
  final sy = height / image!.height;

  canvas
    ..setTransform(
      Matrix4.identity()
        ..translate(x, y + height, 0)
        ..scale(sx, -sy),
    )
    ..drawImage(image!, 0, 0);
}