Links drifting when grid is enabled

I have reproduced my issue in a simple fiddle. I have a node with a link connected to two ports on the node. When grid snapping is enabled, if you drag the node in the diagram you see the link drift gradually to the top left, so it does not stay connected to the ports. Am I doing something wrong here? Still on 1.8. I’ll test it with newer versions to see if it is fixed.

Yep. Still happens on latest. GoJS Sample for JSFIDDLE - JSFiddle - Code Playground

Am I doing something wrong or is this just a bug?

That looks like a bug. We’ll investigate tomorrow. Thanks for reproducing the problem for us.

For now you can avoid the problem by having grid cell sizes (or whatever snapping cell size you want to have happen) be whole integer values.

Or set DraggingTool.isGridSnapRealtime to false.

Awesome. I think I can get away with changing the grid size without affecting customers too much. Thanks for that workaround.

FYI, turns out having fractional grid dimensions was also causing another bug. We have orthogonal links with reshaping enabled. If we create two nodes with a link going between them and then reshape the link, then we select both nodes and the link and drag the selection while grid is visible with snapping enabled part of the link would be anchored in place and the shape of the link would be adjusted unexpectedly.

Just thought I’d let you know about that if you plan on patching the issue. Again, we should be fine to avoid fractional grid dimension from now on.


Thanks again.

A fix will be in the next release, 2.1.31. Thanks again for reporting the problem.

The second situation that you describe would also have the same bug – but in the particular scenario you show, do you have Link.adjusting set to something like go.Link.End?

That is correct. It that case link.adjusting is set to go.Link.End