draw method

  1. @override
void draw(
  1. ChantContext ctxt
)
inherited

Paints this the element on Canvas attached to ctxt.

Implementation

@override
void draw(ChantContext ctxt) {
  if (glyph == null) return;
  final x = bounds.x + origin.x;
  final y = bounds.y + origin.y;
  ctxt.canvas.save();
  ctxt.canvas.translate(x, y);
  ctxt.canvas.scale(ctxt.glyphScaling, ctxt.glyphScaling);

  for (final path in glyph!.paths) {
    ctxt.canvas.drawSvgPath(path.data, _getPathPaint(path, ctxt));
  }

  ctxt.canvas.restore();
}