From 1ff721855829315ff6d3662da45800a74f81a35b Mon Sep 17 00:00:00 2001 From: Yuta Nakamura Date: Wed, 22 Nov 2023 22:40:05 +0900 Subject: [PATCH] fix: flowchart image without text --- packages/mermaid/src/dagre-wrapper/shapes/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/mermaid/src/dagre-wrapper/shapes/util.js b/packages/mermaid/src/dagre-wrapper/shapes/util.js index 079125e3a6..97a1bef8d1 100644 --- a/packages/mermaid/src/dagre-wrapper/shapes/util.js +++ b/packages/mermaid/src/dagre-wrapper/shapes/util.js @@ -80,7 +80,9 @@ export const labelHelper = async (parent, node, _classes, isNode) => { ? getConfig().fontSize : window.getComputedStyle(document.body).fontSize; const enlargingFactor = 5; - img.style.width = parseInt(bodyFontSize, 10) * enlargingFactor + 'px'; + const width = parseInt(bodyFontSize, 10) * enlargingFactor + 'px'; + img.style.minWidth = width; + img.style.maxWidth = width; } else { img.style.width = '100%'; }