paint method

void paint(
  1. Canvas canvas
)

Paints this element on canvas.

Implementation

void paint(Canvas canvas) {
  if (rotation == null) {
    draw(canvas);
  } else {
    canvas.save();

    canvas.translate(rotationAxis!.dx, rotationAxis!.dy);
    canvas.rotate(rotation!);
    canvas.translate(-rotationAxis!.dx, -rotationAxis!.dy);

    draw(canvas);

    canvas.restore();
  }
}