🎉 Support for radial gradients with wasm render

This commit is contained in:
Alejandro Alonso 2024-12-03 14:16:46 +01:00
parent 0eedc036be
commit 09aa4529f8
5 changed files with 106 additions and 16 deletions

View file

@ -175,6 +175,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");