draw method
Draws the contents or children of this Drawable to the canvas
, using
the parentPaint
to optionally override the child's paint.
The bounds
is not used.
Implementation
@override
void draw(Canvas canvas, Rect bounds) {
if (!hasDrawableContent) {
return;
}
if (transform != null) {
canvas.save();
canvas.transform(transform!);
}
if (viewport.viewBoxOffset != Offset.zero) {
canvas.translate(viewport.viewBoxOffset.dx, viewport.viewBoxOffset.dy);
}
for (Drawable child in children) {
child.draw(canvas, viewport.viewBoxRect);
}
if (transform != null) {
canvas.restore();
}
if (viewport.viewBoxOffset != Offset.zero) {
canvas.restore();
}
}