🎉 Suport for show-content in render wasm

This commit is contained in:
Alejandro Alonso 2024-12-09 15:19:14 +01:00
parent 0eedc036be
commit e1d9efea7f
5 changed files with 47 additions and 23 deletions

View file

@ -111,7 +111,15 @@ pub extern "C" fn set_shape_selrect(left: f32, top: f32, right: f32, bottom: f32
}
#[no_mangle]
pub extern "C" fn set_shape_rotation(rotation: f32) {
pub unsafe extern "C" fn set_shape_clip_content(clip_content: bool) {
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
if let Some(shape) = state.current_shape() {
shape.clip_content = clip_content;
}
}
#[no_mangle]
pub unsafe extern "C" fn set_shape_rotation(rotation: f32) {
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
if let Some(shape) = state.current_shape() {
shape.rotation = rotation;