mirror of
https://github.com/penpot/penpot.git
synced 2025-07-19 05:37:22 +02:00
♻️ Switch to a f32 offset for gradient stops
This commit is contained in:
parent
abcd050c69
commit
5765d1c56c
4 changed files with 41 additions and 42 deletions
|
@ -306,7 +306,10 @@ pub extern "C" fn add_shape_fill_stops() {
|
|||
|
||||
let entries: Vec<_> = bytes
|
||||
.chunks(size_of::<shapes::RawStopData>())
|
||||
.map(|data| shapes::RawStopData::from_bytes(data.try_into().unwrap()))
|
||||
.map(|data| {
|
||||
let raw_stop_bytes: [u8; RAW_STOP_DATA_SIZE] = data.try_into().unwrap();
|
||||
shapes::RawStopData::from(raw_stop_bytes)
|
||||
})
|
||||
.collect();
|
||||
|
||||
with_current_shape!(state, |shape: &mut Shape| {
|
||||
|
@ -523,7 +526,10 @@ pub extern "C" fn add_shape_stroke_stops() {
|
|||
|
||||
let entries: Vec<_> = bytes
|
||||
.chunks(size_of::<shapes::RawStopData>())
|
||||
.map(|data| shapes::RawStopData::from_bytes(data.try_into().unwrap()))
|
||||
.map(|data| {
|
||||
let raw_stop_bytes: [u8; RAW_STOP_DATA_SIZE] = data.try_into().unwrap();
|
||||
shapes::RawStopData::from(raw_stop_bytes)
|
||||
})
|
||||
.collect();
|
||||
|
||||
with_current_shape!(state, |shape: &mut Shape| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue