mirror of
https://github.com/penpot/penpot.git
synced 2025-06-24 22:27:01 +02:00
✨ 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:
parent
eaaca5629e
commit
f9bbf2d524
6 changed files with 197 additions and 125 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue