Overview
Currently, there is no way to save modified sketches from the UI other than taking a screenshot (lol).
The UI does have access to the resulting Canvas of a given sketch, so instead of calling EguiRenderer::render_egui to render the UI's view of the sketch, we can call SvgRenderer::render_svg.
The currently implementation of render_svg unconditionally saves the resulting SVG as image.svg in the current working directory. render_svg should be modified to either return the SVG as bytes, or take a path arg.
Unknowns
I do not know if egui has any file saving widgets already, and furthermore, if they exist, how they function in a wasm context. Any solution to this issue must work in both native and web apps.
Overview
Currently, there is no way to save modified sketches from the UI other than taking a screenshot (lol).
The UI does have access to the resulting
Canvasof a given sketch, so instead of callingEguiRenderer::render_eguito render the UI's view of the sketch, we can callSvgRenderer::render_svg.The currently implementation of
render_svgunconditionally saves the resulting SVG asimage.svgin the current working directory.render_svgshould be modified to either return the SVG as bytes, or take apatharg.Unknowns
I do not know if
eguihas any file saving widgets already, and furthermore, if they exist, how they function in a wasm context. Any solution to this issue must work in both native and web apps.