mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
Merge pull request #721 from paulbland/right-angles
Add option for right angles
This commit is contained in:
@@ -220,9 +220,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 + (conf.width / 2)} 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)
|
||||
|
Reference in New Issue
Block a user