Home > @jsplumbtoolkit/browser-ui > encloses
encloses() function
Calculates whether or not r2 is completely enclosed by r1.
Signature:
export declare function encloses(r1: RectangleXY, r2: RectangleXY, allowSharedEdges?: boolean): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
r1 | RectangleXY | First rectangle |
r2 | RectangleXY | Second rectangle |
allowSharedEdges | boolean | If true, the concept of enclosure allows for one or more edges to be shared by the two rectangles. |
Returns:
boolean
True if r1 encloses r2, false otherwise.