(model)
| 1394 | } |
| 1395 | |
| 1396 | async upload_svg(model) { |
| 1397 | const svg_string = await this.get_svg(); |
| 1398 | const svg_blob = new Blob([svg_string], { |
| 1399 | type: 'image/svg+xml;charset=utf-8', |
| 1400 | }); |
| 1401 | const svg_buffer = await svg_blob.arrayBuffer(); |
| 1402 | model.send( |
| 1403 | { |
| 1404 | event: 'upload_svg', |
| 1405 | }, |
| 1406 | null, |
| 1407 | [svg_buffer] |
| 1408 | ); |
| 1409 | } |
| 1410 | |
| 1411 | save_png(filename, scale) { |
| 1412 | // Render a SVG data into a canvas and download as PNG. |