closePath() {
		const points = this.points;
		if (points.length > 0) {
			const firstPoint = points[0];
			if (!firstPoint.equals(points[points.length - 1])) {
				this.lineTo(firstPoint.x, firstPoint.y);
			}
			this.isDirty = true;
		}
	}
causes the point of the pen to move back to the start of the current path.
It tries to draw a straight line from the current point to the start.
If the shape has already been closed or has only one point, this function does nothing.