operator - method

  1. @override
Radius operator -(
  1. Radius other
)
override

Binary subtraction operator.

Returns a radius whose x value is the left-hand-side operand's x minus the right-hand-side operand's x and whose y value is the left-hand-side operand's y minus the right-hand-side operand's y.

Implementation

@override
Radius operator -(Radius other) {
  if (other is SharpRadius) {
    return SharpRadius(
      cornerRadius: cornerRadius - other.cornerRadius,
      sharpRatio: (sharpRatio + other.sharpRatio) / 2,
    );
  }
  return SharpRadius(
    cornerRadius: cornerRadius - other.x,
    sharpRatio: sharpRatio,
  );
}