expandToInclude method

Rectangle expandToInclude(
  1. Rectangle other
)

Returns a new rectangle which is the bounding box containing this rectangle and the given rectangle.

Implementation

Rectangle expandToInclude(Rectangle other) {
  return Rectangle.fromLTRB(
    math.min(left, other.left),
    math.min(top, other.top),
    math.max(right, other.right),
    math.max(bottom, other.bottom),
  );
}