Skip to content

Commit

Permalink
Merge pull request #1 from HK-SHAO/HK-SHAO-patch-interface-changed
Browse files Browse the repository at this point in the history
fix: interface SVG was changed by mistake
  • Loading branch information
HK-SHAO authored Sep 15, 2023
2 parents e504f25 + f0ce4c9 commit bb09d2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/components/Actions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bb09d2e

Please sign in to comment.