+ adjustEndArrow: function(start, end, squareWidth) {
+ // Simple heuristic for now, just remove 1/3 square.
+ // TODO: should depend on the orientation.
+ const delta = [end.x - start.x, end.y - start.y];
+ const dist = Math.sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
+ const fracSqWidth = squareWidth / 3;
+ return {
+ x: end.x - delta[0] * fracSqWidth / dist,
+ y: end.y - delta[1] * fracSqWidth / dist
+ };
+ },