mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 04:36:12 +02:00
🎉 Stroke style support for wasm render
This commit is contained in:
parent
e551dd5a99
commit
2467e033b7
3 changed files with 70 additions and 19 deletions
|
@ -347,26 +347,26 @@ pub extern "C" fn set_shape_path_content() {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add_shape_center_stroke(width: f32) {
|
||||
pub extern "C" fn add_shape_center_stroke(width: f32, style: i32) {
|
||||
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
|
||||
if let Some(shape) = state.current_shape() {
|
||||
shape.add_stroke(shapes::Stroke::new_center_stroke(width))
|
||||
shape.add_stroke(shapes::Stroke::new_center_stroke(width, style));
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add_shape_inner_stroke(width: f32) {
|
||||
pub extern "C" fn add_shape_inner_stroke(width: f32, style: i32) {
|
||||
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
|
||||
if let Some(shape) = state.current_shape() {
|
||||
shape.add_stroke(shapes::Stroke::new_inner_stroke(width))
|
||||
shape.add_stroke(shapes::Stroke::new_inner_stroke(width, style))
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add_shape_outer_stroke(width: f32) {
|
||||
pub extern "C" fn add_shape_outer_stroke(width: f32, style: i32) {
|
||||
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
|
||||
if let Some(shape) = state.current_shape() {
|
||||
shape.add_stroke(shapes::Stroke::new_outer_stroke(width))
|
||||
shape.add_stroke(shapes::Stroke::new_outer_stroke(width, style))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue