diff --git a/public/handwritten/script.js b/public/handwritten/script.js index ab588ab13..11e0c9d8a 100644 --- a/public/handwritten/script.js +++ b/public/handwritten/script.js @@ -600,13 +600,13 @@ var speedSliderElement = getElement('speed-slider'); var widthSliderElement = getElement('width-slider'); widthSliderElement.oninput = () => - ((r) => { - for (; canvasElement.lastChild; ) + ((r) => { + for (; canvasElement.lastChild; ) canvasElement.removeChild(canvasElement.lastChild); if (K(r) != 0) { const e = options.width; /*parseFloat(widthSliderElement.value)* / const a = z(r); for (let l = 0; l < K(a); l++) (r = a[l]), K(r) < 2 || q(r, t, e); - } - })(tr); + } + })(tr); */ let ur; @@ -709,25 +709,25 @@ getElement('loading-indicator').remove(); --------------------------------------- getElement('save-button').addEventListener('click', () => { - const r = getElement('canvas').getBBox(); - const width = [hr(r.x - 3), hr(r.y - 3), hr(r.width + 6), hr(r.height + + const r = getElement('canvas').getBBox(); + const width = [hr(r.x - 3), hr(r.y - 3), hr(r.width + 6), hr(r.height + 6)].join(' '); const svgElement = getElement('canvas'); - svgElement.setAttribute('viewBox', width); - const extremeSvg = new XMLSerializer().serializeToString(svgElement); - svgElement.removeAttribute('viewBox'); - const popOutActionElement = window.document.createElement('a'); - popOutActionElement.setAttribute('href', + svgElement.setAttribute('viewBox', width); + const extremeSvg = new XMLSerializer().serializeToString(svgElement); + svgElement.removeAttribute('viewBox'); + const popOutActionElement = window.document.createElement('a'); + popOutActionElement.setAttribute('href', `data:image/svg+xml;base64,${window.btoa(extremeSvg)}`); - popOutActionElement.setAttribute( - 'download', - `${Z.toString() - .toLowerCase() - .replace(/\s+/g, '-') - .replace(/[^\w\-]+/g, '') - .replace(/\-\-+/g, '-') - .trim()}.svg`, - ); - popOutActionElement.click(); + popOutActionElement.setAttribute( + 'download', + `${Z.toString() + .toLowerCase() + .replace(/\s+/g, '-') + .replace(/[^\w\-]+/g, '') + .replace(/\-\-+/g, '-') + .trim()}.svg`, + ); + popOutActionElement.click(); }); */ }