closePath method

void closePath()

Adds a lineCurve to close the path.

Implementation

void closePath() {
  // Add a line curve if start and end of lines are not connected
  final startPoint = curves[0].getPoint(0);
  final endPoint = curves[curves.length - 1].getPoint(1);

  if (startPoint != null && endPoint != null && !startPoint.equals(endPoint)) {
    curves.add(LineCurve(endPoint, startPoint));
  }
}