expandToInclude method
Creates a new rectangle that includes both this rectangle and the input rectangle.
input The rectangle to include.
Returns a new IntRect that encompasses both rectangles.
Implementation
IntRect expandToInclude(final IntRect input) {
final newLeft = left < input.left ? left : input.left;
final newTop = top < input.top ? top : input.top;
final newRight = right > input.right ? right : input.right;
final newBottom = bottom > input.bottom ? bottom : input.bottom;
return IntRect.fromLTRB(newLeft, newTop, newRight, newBottom);
}