mirror of
https://github.com/penpot/penpot.git
synced 2025-08-02 22:48:35 +02:00
✨ Serialize stroke solid fills as bytes (wasm)
This commit is contained in:
parent
093fa18839
commit
5ae125db94
2 changed files with 11 additions and 5 deletions
|
@ -34,11 +34,13 @@ pub extern "C" fn add_shape_outer_stroke(width: f32, style: u8, cap_start: u8, c
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add_shape_stroke_solid_fill(raw_color: u32) {
|
||||
pub extern "C" fn add_shape_stroke_solid_fill() {
|
||||
with_current_shape!(state, |shape: &mut Shape| {
|
||||
let color = skia::Color::new(raw_color);
|
||||
let bytes = mem::bytes();
|
||||
let solid_color =
|
||||
shapes::SolidColor::try_from(&bytes[..]).expect("Invalid solid color data");
|
||||
shape
|
||||
.set_stroke_fill(shapes::Fill::Solid(shapes::SolidColor(color)))
|
||||
.set_stroke_fill(shapes::Fill::Solid(solid_color))
|
||||
.expect("could not add stroke solid fill");
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue