intersect

infix fun Rectangle.intersect(rectangle: Rectangle): Rectangle(source)

Returns a Rectangle that is the intersection of this and the given one. The result is Empty if there is no intersection.

Return

a Rectangle representing the intersection of the 2 rectangles

Parameters

rectangle

to intersect with