Skip to content

How to adjust Edge path direction when approaching a Port? #1501

Answered by david-pa
david-pa asked this question in Q&A
Discussion options

You must be logged in to vote

@martin-fleck-at I think I found a solution.

I noticed that these lines in ManhattanEdgeRouter > calculateDefaultCorners seem to be called and the rest of the function is skipped over:

protected override calculateDefaultCorners(edge: SRoutableElementImpl, sourceAnchors: DefaultAnchors, targetAnchors: DefaultAnchors, options: ManhattanRouterOptions): Point[] {
        const selfEdge = super.calculateDefaultCorners(edge, sourceAnchors, targetAnchors, options);
        if (selfEdge.length > 0)
            return selfEdge;
        ...

In order to prevent this, I just copied over the logic from this function, minus those lines, and added it to a new class that extends ManhattanEdgeRouter, alo…

Replies: 2 comments 19 replies

Comment options

You must be logged in to vote
3 replies
@david-pa
Comment options

@david-pa
Comment options

@martin-fleck-at
Comment options

Comment options

You must be logged in to vote
16 replies
@rsoika
Comment options

@david-pa
Comment options

@david-pa
Comment options

@david-pa
Comment options

Answer selected by david-pa
@martin-fleck-at
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants