mirror of
https://github.com/penpot/penpot.git
synced 2025-07-30 06:29:30 +02:00
Merge pull request #6583 from penpot/niwinz-fills-binary-type
🎉 Fills as binary type
This commit is contained in:
commit
2cddc6fb5b
111 changed files with 2077 additions and 1347 deletions
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue