Improve paths deserialization (wasm) (#6501)

* ♻️ Refactor path wasm code to its own wasm submodule

* ♻️ Use unified enum for RawSegmentData and transmute to deserialize

* ♻️ Move set_shape_path_attrs to wasm::paths module

* 💄 Unify repr declarations
This commit is contained in:
Belén Albeza 2025-05-23 08:48:55 +02:00 committed by GitHub
parent eaaca5629e
commit f9bbf2d524
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 197 additions and 125 deletions

View file

@ -469,8 +469,8 @@ impl Shape {
self.strokes.clear();
}
pub fn set_path_segments(&mut self, buffer: Vec<RawPathData>) -> Result<(), String> {
let path = Path::try_from(buffer)?;
pub fn set_path_segments(&mut self, segments: Vec<Segment>) {
let path = Path::new(segments);
match &mut self.shape_type {
Type::Bool(Bool { bool_type, .. }) => {
@ -484,7 +484,6 @@ impl Shape {
}
_ => {}
};
Ok(())
}
pub fn set_path_attr(&mut self, name: String, value: String) {