Home > @jsplumbtoolkit/browser-ui > findClosestPoint
findClosestPoint() function
Find the closest point out of locations
to the given point on the given constraining rectangle.
Signature:
export declare function findClosestPoint<T extends PointXY>(pos: PointXY, constrainRect: Size, locations: Array<T>): ClosestPointCandidate<T>;
Parameters
Parameter | Type | Description |
---|---|---|
pos | PointXY | An x,y location in pixel values |
constrainRect | Size | Width/height of the bounding box, in pixels |
locations | Array<T> | A list of x/y logical locations, whose values are proportional lengths (anchor format). |
Returns: