draw method

  1. @override
void draw(
  1. Path context,
  2. num size
)
override

Renders this symbol type to the specified context with the specified size in square pixels.

The context implements the CanvasPathMethods interface. (Note that this is a subset of the CanvasRenderingContext2D interface!) See also d4_path.

Implementation

@override
draw(context, size) {
  final y = sqrt(size / tan30_2);
  final x = y * tan30;
  context.moveTo(0, -y);
  context.lineTo(x, 0);
  context.lineTo(0, y);
  context.lineTo(-x, 0);
  context.closePath();
}