Skip to content

Routes draw a loop instead of straight connection when the distance between shapes is quite short - cause found #67

@KarolBuchta

Description

@KarolBuchta

Rappid v1.7.0

Seen when using orthogonal routing and ports/magnets. Maybe also other routing options.

See example:
http://screencast.com/t/yjctvFXA

The reason for this is in:

joint.dia.LinkView.findRoute()
newVertices = routerFn.call(this, oldVertices or [], args, this)

args contains always the same elementPadding, no matter how long the connection is. I fixed this for me in a hacky way, but you can surely do better.

if @sourceBBox? && @sourceBBox.center().distance(@targetBBox.center()) < 100 #TODO: Use the shortLink option here
  newVertices = routerFn.call(this, oldVertices or [], {elementPadding: 0.00001}, this)
else
  newVertices = routerFn.call(this, oldVertices or [], args, this)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions