created option for right angle arrows

This commit is contained in:
Bland, Paul
2018-08-17 10:56:15 -04:00
parent a4992963b3
commit b80bad0a93
2 changed files with 13 additions and 4 deletions

View File

@@ -218,9 +218,13 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg) {
let line
if (startx === stopx) {
line = g.append('path')
.attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' +
(verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20))
if (conf.rightAngles) {
line = g.append('path').attr('d', `M ${startx},${verticalPos} H ${startx + 75} V ${verticalPos + 25} H ${startx}`)
} else {
line = g.append('path')
.attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' +
(verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20))
}
bounds.bumpVerticalPos(30)
const dx = Math.max(textWidth / 2, 100)