♻️ Switch to a f32 offset for gradient stops

This commit is contained in:
Belén Albeza 2025-04-15 11:04:36 +02:00
parent abcd050c69
commit 5765d1c56c
4 changed files with 41 additions and 42 deletions

View file

@ -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| {