boundingBox method

  1. @override
Rectangle<T> boundingBox(
  1. Rectangle<T> other
)

Returns a rectangle which completely contains this and other.

Implementation

@override
Rectangle<T> boundingBox(math.Rectangle<T> other) {
  final rLeft = min(left, other.left);
  final rTop = min(top, other.top);
  final rRight = max(right, other.right);
  final rBottom = max(bottom, other.bottom);
  return Rectangle<T>(rLeft, rTop, rRight - rLeft as T, rBottom - rTop as T);
}