gooPairDepth function

double gooPairDepth(
  1. Rect a,
  2. double radius,
  3. Rect b,
  4. double blend,
)

How far inside a, rounded by radius, all of b lies past where blend still swells a's outline toward it; negative while it does.

Implementation

double gooPairDepth(Rect a, double radius, Rect b, double blend) {
  final outermost = [
    b.topLeft,
    b.topRight,
    b.bottomLeft,
    b.bottomRight,
  ].map((corner) => _roundedDistance(a, radius, corner)).reduce(math.max);
  return -outermost - blend;
}