I don’t think we really understand what behavior you want.
But try an override of Link.computePoints that is like:
CustomLink.prototype.computePoints = function() {
var fromport = this.fromPort;
var toport = this.toPort;
var num = this.pointsCount;
if (fromport === toport && fromport !== null && num >= 4) {
var oldpts = this.points;
var ortho = false;
var fromnode = this.fromNode;
var fromspot = this.computeSpot(true);
var tonode = this.toNode;
var tospot = this.computeSpot(false);
var fromPoint = this.getLinkPoint(fromnode, fromport, fromspot, true, ortho, tonode, toport);
var fromDir = this.getLinkDirection(fromnode, fromport, fromPoint, fromspot, true, ortho, tonode, toport);
var fromSeg = this.computeEndSegmentLength(fromnode, fromport, fromspot, true);
var toPoint = this.getLinkPoint(tonode, toport, tospot, false, ortho, fromnode, fromport);
var toDir = this.getLinkDirection(tonode, toport, toPoint, tospot, false, ortho, fromnode, fromport);
var toSeg = this.computeEndSegmentLength(tonode, toport, tospot, false);
var Bx = fromSeg * Math.cos(fromDir * Math.PI / 180);
var By = fromSeg * Math.sin(fromDir * Math.PI / 180);
var Cx = toSeg * Math.cos(toDir * Math.PI / 180);
var Cy = toSeg * Math.sin(toDir * Math.PI / 180);
var b = new go.Point(fromPoint.x + Bx, fromPoint.y + By);
var c = new go.Point(toPoint.x + Cx, toPoint.y + Cy);
this.adjustPoints(1, b, num - 2, c);
this.setPoint(0, fromPoint);
this.setPoint(num - 1, toPoint);
return true;
} else {
return go.Link.prototype.computePoints.call(this);
}
};
You may need to improve the code to match your expectations.