This commit is contained in:
Eduardas Michelsonas 2019-08-28 20:13:37 +02:00
parent f6377e6125
commit c6efddee87

View File

@ -224,7 +224,7 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg, sequenceInd
.text(breakline.trim()) .text(breakline.trim())
counterBreaklines++ counterBreaklines++
} }
const offsetLineCounter = counterBreaklines-1 const offsetLineCounter = counterBreaklines - 1
const totalOffset = offsetLineCounter * breaklineOffset const totalOffset = offsetLineCounter * breaklineOffset
let textWidth = (textElem._groups || textElem)[0][0].getBBox().width let textWidth = (textElem._groups || textElem)[0][0].getBBox().width
@ -239,7 +239,7 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg, sequenceInd
(verticalPos + 30 + totalOffset) + ' ' + startx + ',' + (verticalPos + 20 + totalOffset)) (verticalPos + 30 + totalOffset) + ' ' + startx + ',' + (verticalPos + 20 + totalOffset))
} }
bounds.bumpVerticalPos(30+totalOffset) bounds.bumpVerticalPos(30 + totalOffset)
const dx = Math.max(textWidth / 2, 100) const dx = Math.max(textWidth / 2, 100)
bounds.insert(startx - dx, bounds.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds.getVerticalPos() + totalOffset) bounds.insert(startx - dx, bounds.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds.getVerticalPos() + totalOffset)
} else { } else {
@ -248,7 +248,7 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg, sequenceInd
line.attr('y1', verticalPos) line.attr('y1', verticalPos)
line.attr('x2', stopx) line.attr('x2', stopx)
line.attr('y2', verticalPos) line.attr('y2', verticalPos)
bounds.insert(startx, bounds.getVerticalPos() - 10 + totalOffset, stopx, bounds.getVerticalPos()) + totalOffset bounds.insert(startx, bounds.getVerticalPos() - 10 + totalOffset, stopx, bounds.getVerticalPos() + totalOffset)
} }
// Make an SVG Container // Make an SVG Container
// Draw the line // Draw the line