mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 14:59:53 +02:00
Fixed default size if not provided in height/width
This commit is contained in:
@@ -12,6 +12,29 @@ export const filledCircle = (
|
||||
{ config: { themeVariables } }: RenderOptions
|
||||
) => {
|
||||
node.label = '';
|
||||
|
||||
// If incoming height & width are present, subtract the padding from them
|
||||
// as labelHelper does not take padding into account
|
||||
// also check if the width or height is less than minimum default values (50),
|
||||
// if so set it to min value
|
||||
if (node.width || node.height) {
|
||||
if ((node.width ?? 0) < 50) {
|
||||
node.width = 50;
|
||||
}
|
||||
|
||||
if ((node.height ?? 0) < 50) {
|
||||
node.height = 50;
|
||||
}
|
||||
}
|
||||
|
||||
if (!node.width) {
|
||||
node.width = 50;
|
||||
}
|
||||
|
||||
if (!node.height) {
|
||||
node.width = 50;
|
||||
}
|
||||
|
||||
const shapeSvg = parent
|
||||
.insert('g')
|
||||
.attr('class', getNodeClasses(node))
|
||||
|
Reference in New Issue
Block a user