Skip to content

Commit

Permalink
check for text element node existance
Browse files Browse the repository at this point in the history
  • Loading branch information
FezVrasta committed Apr 8, 2024
1 parent 2f5f48e commit ff34dbc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/mermaid/src/diagrams/sequence/svgDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,15 @@ export const drawText = function (elem, textData) {
} else {
textElem.text(text);
}

const textElemNode = (textElem._groups || textElem)[0][0]
if (
textElemNode &&
textData.valign !== undefined &&
textData.textMargin !== undefined &&
textData.textMargin > 0
) {
textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
textHeight += textElemNode.getBBox().height;
prevTextHeight = textHeight;
}

Expand Down

0 comments on commit ff34dbc

Please sign in to comment.