getClip method

  1. @override
Path getClip(
  1. Size size
)
override

Returns a description of the clip given that the render object being clipped is of the given size.

Implementation

@override
Path getClip(Size size) {
  var path = Path();
  double radius =
      value * sqrt(size.height * size.height + size.width * size.width);
  // AppConfig.printLog(radius);
  //右上角
  // path.addOval(Rect.fromLTRB(
  //     size.width - radius, -radius, size.width + radius, radius));
  //右边
  // path.addOval(Rect.fromLTRB(
  //     radius, size.width + radius, -radius, size.width - radius));
  //
  path.addOval(Rect.fromCenter(
      center: center ?? Offset(size.width / 2, size.height),
      width: radius * 2,
      height: radius * 2));
  return path;
}