Merge pull request #5410 from penpot/superalex-radial-gradients-wasm-render

🎉 Support for radial gradients with wasm render
This commit is contained in:
Belén Albeza 2024-12-10 14:18:09 +01:00 committed by GitHub
commit 33e70a4108
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 106 additions and 16 deletions

View file

@ -183,6 +183,26 @@ pub extern "C" fn add_shape_linear_fill(
}
}
#[no_mangle]
pub extern "C" fn add_shape_radial_fill(
start_x: f32,
start_y: f32,
end_x: f32,
end_y: f32,
opacity: f32,
width: f32,
) {
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
if let Some(shape) = state.current_shape() {
shape.add_fill(shapes::Fill::new_radial_gradient(
(start_x, start_y),
(end_x, end_y),
opacity,
width,
))
}
}
#[no_mangle]
pub extern "C" fn add_shape_fill_stops(ptr: *mut shapes::RawStopData, n_stops: u32) {
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");