absellipse method

Path absellipse(
  1. double aX,
  2. double aY,
  3. double xRadius,
  4. double yRadius,
  5. double aStartAngle,
  6. double aEndAngle, [
  7. bool? aClockwise,
  8. double? aRotation,
])

aX, aY -- The absolute center of the ellipse.

xRadius -- The radius of the ellipse in the x axis.

yRadius -- The radius of the ellipse in the y axis.

aStartAngle -- The start angle in radians.

aEndAngle -- The end angle in radians.

aClockwise -- Sweep the ellipse clockwise. Defaults to false.

aRotation -- The rotation angle of the ellipse in radians, counterclockwise from the positive X axis. Optional, defaults to 0.

Adds an absolutely positioned EllipseCurve to the path.

Implementation

Path absellipse(double aX, double aY, double xRadius, double yRadius, double aStartAngle, double aEndAngle, [bool? aClockwise, double? aRotation]) {
  final curve = EllipseCurve(aX, aY, xRadius, yRadius, aStartAngle,
      aEndAngle, aClockwise, aRotation);

  if (curves.isNotEmpty) {
    // if a previous curve is present, attempt to join
    final firstPoint = curve.getPoint(0);

    if (firstPoint != null && !firstPoint.equals(currentPoint)) {
      lineTo(firstPoint.x, firstPoint.y);
    }
  }

  curves.add(curve);

  final lastPoint = curve.getPoint(1);
  if(lastPoint != null){
    currentPoint.setFrom(lastPoint);
  }

  return this;
}