mirror of
https://github.com/penpot/penpot.git
synced 2025-06-21 11:46:59 +02:00
✨ Send all fills of a shape in a single wasm call
This commit is contained in:
parent
e9bd44b819
commit
9fc3f4858a
3 changed files with 43 additions and 20 deletions
|
@ -63,6 +63,15 @@ pub fn parse_fills_from_bytes(buffer: &[u8], num_fills: usize) -> Vec<shapes::Fi
|
|||
.collect()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn set_shape_fills() {
|
||||
with_current_shape!(state, |shape: &mut Shape| {
|
||||
let bytes = mem::bytes();
|
||||
let fills = parse_fills_from_bytes(&bytes, bytes.len() / RAW_FILL_DATA_SIZE);
|
||||
shape.set_fills(fills);
|
||||
});
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add_shape_fill() {
|
||||
with_current_shape!(state, |shape: &mut Shape| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue