mirror of
https://github.com/penpot/penpot.git
synced 2025-06-21 10:37:01 +02:00
🎉 Add text fills
This commit is contained in:
parent
c2ce7c6cf6
commit
42ef2f929a
11 changed files with 451 additions and 279 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue