mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-24 01:39:53 +02:00
Change class member height to use own BBox
This commit is contained in:
@@ -917,7 +917,9 @@ const class_box = (parent, node) => {
|
|||||||
((-1 * maxHeight) / 2 + verticalPos + lineHeight / 2) +
|
((-1 * maxHeight) / 2 + verticalPos + lineHeight / 2) +
|
||||||
')'
|
')'
|
||||||
);
|
);
|
||||||
verticalPos += classTitleBBox.height + rowPadding;
|
//get the height of the bounding box of each member if exists
|
||||||
|
const memberBBox = lbl ? lbl.getBBox() : null;
|
||||||
|
verticalPos += (memberBBox.height ?? 0) + rowPadding;
|
||||||
});
|
});
|
||||||
|
|
||||||
verticalPos += lineHeight;
|
verticalPos += lineHeight;
|
||||||
@@ -935,7 +937,8 @@ const class_box = (parent, node) => {
|
|||||||
'transform',
|
'transform',
|
||||||
'translate( ' + -maxWidth / 2 + ', ' + ((-1 * maxHeight) / 2 + verticalPos) + ')'
|
'translate( ' + -maxWidth / 2 + ', ' + ((-1 * maxHeight) / 2 + verticalPos) + ')'
|
||||||
);
|
);
|
||||||
verticalPos += classTitleBBox.height + rowPadding;
|
const methodBBox = lbl ? lbl.getBBox() : null;
|
||||||
|
verticalPos += (methodBBox.height ?? 0) + rowPadding;
|
||||||
});
|
});
|
||||||
|
|
||||||
rect
|
rect
|
||||||
|
Reference in New Issue
Block a user