🎉 Add text fills

This commit is contained in:
Elena Torro 2025-05-09 15:53:11 +02:00
parent c2ce7c6cf6
commit 42ef2f929a
11 changed files with 451 additions and 279 deletions

View file

@ -53,6 +53,18 @@ impl TryFrom<&[u8]> for RawFillData {
}
}
pub fn parse_fills_from_bytes(buffer: &[u8], num_fills: usize) -> Vec<shapes::Fill> {
buffer
.chunks_exact(RAW_FILL_DATA_SIZE)
.take(num_fills)
.map(|bytes| {
RawFillData::try_from(bytes)
.expect("Invalid fill data")
.into()
})
.collect()
}
#[no_mangle]
pub extern "C" fn add_shape_fill() {
with_current_shape!(state, |shape: &mut Shape| {