Guidelines and snapping to assist in making straight links?

We’d like to add a feature from the GuidedDraggingTool to the LinkShiftingTool so that when shifting a link guidelines are presented to assist in creating straight links. Can you give some guidance for how that might be accomplished or suggest a starting point for this work?

Thank you.

GuidedDraggingTool.prototype.doDragOver calls its own showHorizontalMatches and showVerticalMatches, which happens effectively on every mouse/touch move.

You’d want to do something similar, that is, set up a bunch of guideline parts and show them (or not) based on some criteria.

instead of doDragOver, you’d probably want to show them at the end of LinkShiftingTool.prototype.doMouseMove

From there, it kinda depends what you want to do. Do you want the guidelines to appear when your mouse point (or when the resulting point of doReshape) is near the center of the object? Or something else?

Also have you seen http://gojs.net/latest/extensions/SnapLinkReshaping.html ? The custom LinkReshapingTool is defined at http://gojs.net/latest/extensions/SnapLinkReshapingTool.js.