Merged PR 392: Events: Fix needing to use setTimeout for callbacks

This commit is contained in:
Eric Nguyen 2023-03-01 09:53:06 +00:00
parent 6792d5e105
commit 460669987d
8 changed files with 182 additions and 88 deletions

View file

@ -75,10 +75,10 @@ export function SaveEditorAsSVG(): void {
}
// add xml declaration
source = '<?xml version="1.0" standalone="no"?>\r\n' + source;
source = `<?xml version="1.0" standalone="no"?>\r\n${source}`;
// convert svg source to URI data scheme.
const url = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(source);
const url = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(source)}`;
CreateDownloadNode('state.svg', url);
}