nightgraph icon indicating copy to clipboard operation
nightgraph copied to clipboard

Render to SVG from nightgraph-ui

Open kneitinger opened this issue 4 years ago • 0 comments

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.

kneitinger avatar Oct 20 '21 01:10 kneitinger