SVG import (#1579)

* SVG import

* Fix error

* Transforms

* Code review nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube 2024-01-17 01:42:48 +00:00 committed by GitHub
parent 8eef96511e
commit 002151d9c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 528 additions and 93 deletions

View file

@ -660,6 +660,13 @@ impl JsEditorHandle {
self.dispatch(message);
}
#[wasm_bindgen(js_name = pasteSvg)]
pub fn paste_svg(&self, svg: String, mouse_x: Option<f64>, mouse_y: Option<f64>) {
let mouse = mouse_x.and_then(|x| mouse_y.map(|y| (x, y)));
let message = DocumentMessage::PasteSvg { svg, mouse };
self.dispatch(message);
}
/// Toggle visibility of a layer from the layer list
#[wasm_bindgen(js_name = toggleLayerVisibility)]
pub fn toggle_layer_visibility(&self, id: u64) {