🎉 Add keep-aspect-ratio integration

This commit is contained in:
Aitor Moreno
2025-07-21 11:31:19 +02:00
committed by Andrey Antukh
parent 8bb210e7b6
commit ffb688696b
2 changed files with 12 additions and 6 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,
)
}
}