mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Merge pull request #4181 from ischanx/fix-getbbox-cache
fix(squence): getBBox() returns zero
This commit is contained in:
commit
141d38b4e7
@ -772,6 +772,9 @@ export const calculateTextDimensions: (
|
||||
.style('font-family', fontFamily);
|
||||
|
||||
const bBox = (textElem._groups || textElem)[0][0].getBBox();
|
||||
if (bBox.width === 0 && bBox.height === 0) {
|
||||
throw new Error('svg element not in render tree');
|
||||
}
|
||||
dim.width = Math.round(Math.max(dim.width, bBox.width));
|
||||
cheight = Math.round(bBox.height);
|
||||
dim.height += cheight;
|
||||
|
Loading…
x
Reference in New Issue
Block a user