Skip to main content

Home > @jsplumbtoolkit/connector-editors > relocateDynamicAnchor

relocateDynamicAnchor() function#

Relocate the given dynamic anchor according to the given proximity of pos to each of the anchor's supported locations. the face is changed on the anchor itself (and the anchor is locked), and in this case we simply return the current value of pos, meaning the user sees the drag proxy under the mouse cursor, which is probably not where the anchor is now positioned, but it makes for a better UX. on drag stop, for all anchor types, the anchor proxy is relocated to the current value.

Signature:

export declare function relocateDynamicAnchor(anchor: LightweightAnchor, ep: Endpoint, pos: PointXY, dragEl: Element, constrainRect: BoundingBox, elementSize: Size, idx: number, connector: AbstractConnector): PointXY;

Parameters#

ParameterTypeDescription
anchorLightweightAnchor
epEndpoint
posPointXY
dragElElement
constrainRectBoundingBox
elementSizeSize
idxnumber
connectorAbstractConnector

Returns:

PointXY