IGxRect.IntersectsWith

Syntax

IntersectsWith(Rect: IGxRect): Boolean;

Parameters

Rect. Integer rectangle, with which it is necessary to check intersection.

Description

The IntersectsWith method checks if the current rectangle intersects with the rectangle passed as an input parameter.

Example

Sub UserProc;
Var
    r1, r2: IGxRect;
    b: Boolean;
Begin
    r1 := New GxRect.Create(-10, -10, Math.RandBetweenI(020), Math.RandBetweenI(020));
    r2 := New GxRect.Create(00, Math.RandBetweenI(010), Math.RandBetweenI(010));
    b := r1.IntersectsWith(r2);
    Debug.WriteLine(b ? "Rectangles intersect" : "Rectangles do not intersect");
End Sub UserProc;

After executing the example two rectangles with fixed start points but random size are created. The development environment console displays a message about intersection of the obtained rectangles.

See also:

IGxRect