Merge pull request #1302 from HK-SHAO/develop

fix: interface SVG was changed by mistake
This commit is contained in:
Sidharth Vinod
2023-11-09 23:32:34 +05:30
committed by GitHub
+4
View File
@@ -15,6 +15,10 @@
`mermaid-diagram-${dayjs().format('YYYY-MM-DD-HHmmss')}.${ext}`;
const getBase64SVG = (svg?: HTMLElement, width?: number, height?: number): string => {
if (svg) {
// Prevents the SVG size of the interface from being changed
svg = svg.cloneNode(true) as HTMLElement;
}
height && svg?.setAttribute('height', `${height}px`);
width && svg?.setAttribute('width', `${width}px`); // Workaround https://stackoverflow.com/questions/28690643/firefox-error-rendering-an-svg-image-to-html5-canvas-with-drawimage
if (!svg) {