Skip to main content

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

ParameterTypeDescription
r1RectangleXYFirst rectangle
r2RectangleXYSecond rectangle
allowSharedEdgesbooleanIf 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.