intersect

fun intersect(x: Int, y: Int, width: Int, height: Int): Boolean

Computes the intersection of this viewport and a specified viewport, storing the result in this viewport and returning whether the viewport intersects. Two viewport intersect when both overlap by a non-zero amount. An empty viewport never intersects another viewport.
When there is no intersection, this returns false and leaves this viewport unchanged. To test for intersection without modifying this viewport, use intersects.

Return

true if this viewport intersects the specified viewport, false otherwise

Parameters

x

the X component of the viewport to intersect with

y

the Y component of the viewport to intersect with

width

the viewport width to intersect with

height

the viewport height to intersect with


fun intersect(viewport: Viewport): Boolean

Computes the intersection of this viewport and a specified viewport, storing the result in this viewport and returning whether the viewport intersects. Two viewport intersect when both overlap by a non-zero amount. An empty viewport never intersects another viewport.
When there is no intersection, this returns false and leaves this viewport unchanged. To test for intersection without modifying this viewport, use intersects.

Return

true if this viewport intersects the specified viewport, false otherwise

Parameters

viewport

the viewport to intersect with