addSharpTopRight method

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

Implementation

void addSharpTopRight(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
      ..moveTo(
        math.max(width / 2, width - p),
        0,
      )
      ..cubicTo(
        width - (p - a),
        0,
        width - (p - a - b),
        0,
        width - (p - a - b - c),
        d,
      )
      ..relativeArcToPoint(
        Offset(
          radius.circularSectionLength,
          radius.circularSectionLength,
        ),
        radius: radius.radius,
      )
      ..cubicTo(
        width,
        p - a - b,
        width,
        p - a,
        width,
        math.min(height / 2, p),
      );
  } else {
    this
      ..moveTo(width / 2, 0)
      ..lineTo(width, 0)
      ..lineTo(width, height / 2);
  }
}