addSharpTopLeft method

void addSharpTopLeft(
  1. SharpProcessedRadius radius,
  2. Rect rect
)

Implementation

void addSharpTopLeft(SharpProcessedRadius radius, Rect rect) {
  final width = rect.width;
  final height = rect.height;
  if (radius.radius.cornerRadius > 0) {
    final a = radius.a;
    final b = radius.b;
    final c = radius.c;
    final d = radius.d;
    final p = radius.p;
    this
      ..lineTo(
        0,
        math.min(height / 2, p),
      )
      ..cubicTo(
        0,
        p - a,
        0,
        p - a - b,
        d,
        p - a - b - c,
      )
      ..relativeArcToPoint(
        Offset(
          radius.circularSectionLength,
          -radius.circularSectionLength,
        ),
        radius: radius.radius,
      )
      ..cubicTo(
        p - a - b,
        0,
        p - a,
        0,
        math.min(width / 2, p),
        0,
      )
      ..close();
  } else {
    this
      ..lineTo(0, 0)
      ..close();
  }
}