union

fun union(left: Int, top: Int, right: Int, bottom: Int)

Update this Rect to enclose itself and the specified rectangle. If the specified rectangle is empty, nothing is done. If this rectangle is empty it is set to the specified rectangle.

Parameters

left

The left edge being unioned with this rectangle

top

The top edge being unioned with this rectangle

right

The right edge being unioned with this rectangle

bottom

The bottom edge being unioned with this rectangle


fun union(r: Rect)

Update this Rect to enclose itself and the specified rectangle. If the specified rectangle is empty, nothing is done. If this rectangle is empty it is set to the specified rectangle.

Parameters

r

The rectangle being unioned with this rectangle


fun union(x: Int, y: Int)

Update this Rect to enclose itself and the x,y coordinate. There is no check to see that this rectangle is non-empty.

Parameters

x

The x coordinate of the point to add to the rectangle

y

The y coordinate of the point to add to the rectangle