Skip to content

@jtopo/core / AnchorProxy

Class: AnchorProxy

AnchorProxy 是 Anchor类的代理,用于计算锚点在宿主对象上的位置

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AnchorProxy(anchor, host?)

Parameters

NameType
anchorAnchor
host?Node | Link

Properties

anchor

anchor: Anchor

锚点


host

Optional host: Node | Link

宿主对象

Methods

equals

equals(other): boolean

Parameters

NameType
otherAnchorProxy

Returns

boolean


hasHost

hasHost(): boolean

Returns

boolean


isDisplayObjectHost

isDisplayObjectHost(): boolean

Returns

boolean


isNodeHost

isNodeHost(): boolean

Returns

boolean


toJSON

toJSON(objIndexMap?): any

Parameters

NameType
objIndexMap?Map<NE, number>

Returns

any


toPoint

toPoint(): PointLike

计算并转换为点

Returns

PointLike


calcPointByAnchor

Static calcPointByAnchor(host, anchor): PointLike

Parameters

NameType
hostNode | Link
anchorAnchor

Returns

PointLike


Static getAutoPointOnLink(link, anchorProxy, otherAnchorProxy): PointLike

Parameters

NameType
linkLink
anchorProxyAnchorProxy
otherAnchorProxyAnchorProxy

Returns

PointLike


getOnLinkPoint

Static getOnLinkPoint(link, anchorProxy): PointLike

Parameters

NameType
linkLink
anchorProxyAnchorProxy

Returns

PointLike


getPointOnLinkHost

Static getPointOnLinkHost(hostLink, anchor): PointLike

Parameters

NameType
hostLinkLink
anchorAnchor

Returns

PointLike


getPointOnNodeHost

Static getPointOnNodeHost(hostNode, anchor): PointLike

Parameters

NameType
hostNodeNode
anchorAnchor

Returns

PointLike


toLinkLocalPoint

Static toLinkLocalPoint(link, host, pointInHostLocal): PointLike

Parameters

NameType
linkLink
hostNode | Link
pointInHostLocalPointLike

Returns

PointLike