Dragcomputation for link 'stutters'


I implemented a simple dragcomputation for links, and the snapping function causes the link to ‘jump around’ or stutter. I downloaded DraggableLink.html and it is easily reproduceable:

myDiagram.linkTemplate =
  $(go.Link,  // the whole link panel
    { selectable: true, selectionAdornmentTemplate: linkSelectionAdornmentTemplate },
    { relinkableFrom: true, relinkableTo: true, reshapable: true },
      routing: go.Link.AvoidsNodes,
      curve: go.Link.JumpOver,
      corner: 5,
      toShortLength: 4,
      dragComputation: computeLinkSnap, //drag computation function
    new go.Binding("points").makeTwoWay(),
    $(go.Shape,  // the link path shape
      { isPanelMain: true, strokeWidth: 2 }),
    $(go.Shape,  // the arrowhead
      { toArrow: "Standard", stroke: null }),
    $(go.Panel, "Auto",
      new go.Binding("visible", "isSelected").ofObject(),
      $(go.Shape, "RoundedRectangle",  // the link shape
        { fill: "#F8F8F8", stroke: null }),
          textAlign: "center",
          font: "10pt helvetica, arial, sans-serif",
          stroke: "#919191",
          margin: 2,
          minSize: new go.Size(10, NaN),
          editable: true
        new go.Binding("text").makeTwoWay())

function computeLinkSnap( part, pt, gridpt )
return gridpt;

Any ideas as to what is causing this behavior?

We see what you mean. This is probably a bug, we’ll investigate and get back to you.

We’ve just released 1.8.32, which sdhould fix these problems. Let me know if you see anything else unexpected.