drawLine method

void drawLine(
  1. num x1,
  2. num y1,
  3. num x2,
  4. num y2,
)

A utility for drawing lines.

Implementation

void drawLine(num x1, num y1, num x2, num y2) {
  _ctx.beginPath();
  _ctx.moveTo(x1, y1);
  _ctx.lineTo(x2, y2);
  _ctx.stroke();
}