Apply Transformation::scale_factor to Quad styling
This commit is contained in:
parent
d3a0d0b512
commit
ab04751bc4
2 changed files with 20 additions and 4 deletions
|
|
@ -263,3 +263,16 @@ impl From<Radius> for [f32; 4] {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::ops::Mul<f32> for Radius {
|
||||||
|
type Output = Self;
|
||||||
|
|
||||||
|
fn mul(self, scale: f32) -> Self::Output {
|
||||||
|
Self {
|
||||||
|
top_left: self.top_left * scale,
|
||||||
|
top_right: self.top_right * scale,
|
||||||
|
bottom_right: self.bottom_right * scale,
|
||||||
|
bottom_left: self.bottom_left * scale,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,14 @@ impl Layer {
|
||||||
position: [bounds.x, bounds.y],
|
position: [bounds.x, bounds.y],
|
||||||
size: [bounds.width, bounds.height],
|
size: [bounds.width, bounds.height],
|
||||||
border_color: color::pack(quad.border.color),
|
border_color: color::pack(quad.border.color),
|
||||||
border_radius: quad.border.radius.into(),
|
border_radius: (quad.border.radius * transformation.scale_factor())
|
||||||
border_width: quad.border.width,
|
.into(),
|
||||||
|
border_width: quad.border.width * transformation.scale_factor(),
|
||||||
shadow_color: color::pack(quad.shadow.color),
|
shadow_color: color::pack(quad.shadow.color),
|
||||||
shadow_offset: quad.shadow.offset.into(),
|
shadow_offset: (quad.shadow.offset * transformation.scale_factor())
|
||||||
shadow_blur_radius: quad.shadow.blur_radius,
|
.into(),
|
||||||
|
shadow_blur_radius: quad.shadow.blur_radius
|
||||||
|
* transformation.scale_factor(),
|
||||||
snap: quad.snap as u32,
|
snap: quad.snap as u32,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue