closePath method

void closePath()

The CanvasRenderingContext2D.closePath() method of the Canvas 2D API attempts to add a straight line from the current point to the start of the current sub-path. If the shape has already been closed or has only one point, this function does nothing.

This method doesn't draw anything to the canvas directly. You can render the path using the CanvasRenderingContext2D.stroke or CanvasRenderingContext2D.fill methods.

Implementation

external void closePath();