Skip to content

Commit

Permalink
Merge pull request #1302 from HK-SHAO/develop
Browse files Browse the repository at this point in the history
fix: interface SVG was changed by mistake
  • Loading branch information
sidharthv96 authored Nov 9, 2023
2 parents 796d1b9 + fad0009 commit fd411e4
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 fd411e4

Please sign in to comment.