diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index 1cc55da7ad..9ed04e556e 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -297,8 +297,12 @@ (store-image id))) (some? color) - (let [rgba (sr-clr/hex->u32argb color opacity)] - (h/call wasm/internal-module "_add_shape_stroke_solid_fill" rgba))))) + (let [size sr-fills/SOLID-BYTE-SIZE + offset (mem/alloc-bytes size) + heap (mem/get-heap-u32) + argb (sr-clr/hex->u32argb color opacity)] + (sr-fills/write-solid-fill! offset heap argb) + (h/call wasm/internal-module "_add_shape_stroke_solid_fill"))))) strokes)) (defn set-shape-path-attrs diff --git a/render-wasm/src/wasm/strokes.rs b/render-wasm/src/wasm/strokes.rs index 2912b9a37e..ef4a1f61d8 100644 --- a/render-wasm/src/wasm/strokes.rs +++ b/render-wasm/src/wasm/strokes.rs @@ -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"); }); }