Discover the direction in which a link was drawn


Is it possible to determine in which direction a link was drawn?

I have a listener for drawn and relinked events:

    diagram.addDiagramListener("LinkDrawn", event => { this.linkedOrRelinked(event); });
    diagram.addDiagramListener("LinkRelinked", event => { this.linkedOrRelinked(event); });

Just to be clear, the link itself has a natural direction, I understand (via from and to). But if a link is drawn by dragging from the to port to the from port, I would like to distinguish this from the case in which it is drawn by dragging from the from port to the to port.


You cannot tell that from the Link object (the DiagramEvent.subject) that was newly drawn or reconnected, but you could look at the LinkingTool or RelinkingTool: LinkingBaseTool.isForwards.


perfect, thanks.