defaultBezierTailBuilder static method

Path defaultBezierTailBuilder(
  1. Offset tip,
  2. Offset point2,
  3. Offset point3
)

Draws a bezier closed triangle path for the tail.

Implementation

static Path defaultBezierTailBuilder(
  Offset tip,
  Offset point2,
  Offset point3,
) {
  final offsetBetween = Offset(
    lerpDouble(point2.dx, point3.dx, 0.5)!,
    lerpDouble(point2.dy, point3.dy, 0.5)!,
  );

  return Path()
    ..moveTo(tip.dx, tip.dy)
    ..quadraticBezierTo(
      offsetBetween.dx,
      offsetBetween.dy,
      point2.dx,
      point2.dy,
    )
    ..lineTo(point3.dx, point3.dy)
    ..quadraticBezierTo(
      offsetBetween.dx,
      offsetBetween.dy,
      tip.dx,
      tip.dy,
    )
    ..close();
}