Add Frame setters for rounding, margin and shadow
This commit is contained in:
parent
12334addda
commit
06fc9afb1d
1 changed files with 16 additions and 0 deletions
|
@ -103,6 +103,22 @@ impl Frame {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn corner_radius(mut self, corner_radius: f32) -> Self {
|
||||||
|
self.corner_radius = corner_radius;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Margin on each side of the frame.
|
||||||
|
pub fn margin(mut self, margin: impl Into<Vec2>) -> Self {
|
||||||
|
self.margin = margin.into();
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn shadow(mut self, shadow: Shadow) -> Self {
|
||||||
|
self.shadow = shadow;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn multiply_with_opacity(mut self, opacity: f32) -> Self {
|
pub fn multiply_with_opacity(mut self, opacity: f32) -> Self {
|
||||||
self.fill = self.fill.linear_multiply(opacity);
|
self.fill = self.fill.linear_multiply(opacity);
|
||||||
self.stroke.color = self.stroke.color.linear_multiply(opacity);
|
self.stroke.color = self.stroke.color.linear_multiply(opacity);
|
||||||
|
|
Loading…
Reference in a new issue