Merge pull request #6583 from penpot/niwinz-fills-binary-type

🎉 Fills as binary type
This commit is contained in:
Aitor Moreno 2025-07-23 09:26:26 +02:00 committed by GitHub
commit 2cddc6fb5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
111 changed files with 2077 additions and 1347 deletions

View file

@ -11,6 +11,7 @@ pub struct RawImageFillData {
opacity: f32,
width: i32,
height: i32,
keep_aspect_ratio: i32,
}
impl From<RawImageFillData> for ImageFill {
@ -18,7 +19,12 @@ impl From<RawImageFillData> for ImageFill {
let id = uuid_from_u32_quartet(value.a, value.b, value.c, value.d);
let opacity = (value.opacity * 255.).floor() as u8;
// TODO: read keep_aspect_ratio from RawImageFillData when implemented
Self::new(id, opacity, value.width, value.height, true)
Self::new(
id,
opacity,
value.width,
value.height,
value.keep_aspect_ratio != 0,
)
}
}