lineTo method

void lineTo(
  1. num x,
  2. num y
)

The CanvasRenderingContext2D method lineTo(), part of the Canvas 2D API, adds a straight line to the current sub-path by connecting the sub-path's last point to the specified (x, y) coordinates.

Like other methods that modify the current path, this method does not directly render anything. To draw the path onto a canvas, you can use the CanvasRenderingContext2D.fill or CanvasRenderingContext2D.stroke methods.

Implementation

external void lineTo(
  num x,
  num y,
);