fix(rule): allow changing thickness after creation
This commit is contained in:
parent
70f54c994a
commit
716c75da3f
1 changed files with 2 additions and 8 deletions
|
|
@ -105,20 +105,14 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the width of the rule
|
/// Set the width of the rule
|
||||||
/// Will not be applied if it is vertical
|
|
||||||
pub fn width(mut self, width: impl Into<Length>) -> Self {
|
pub fn width(mut self, width: impl Into<Length>) -> Self {
|
||||||
if !self.is_vertical {
|
self.width = width.into();
|
||||||
self.width = width.into();
|
|
||||||
}
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the height of the rule
|
/// Set the height of the rule
|
||||||
/// Will not be applied if it is horizontal
|
|
||||||
pub fn height(mut self, height: impl Into<Length>) -> Self {
|
pub fn height(mut self, height: impl Into<Length>) -> Self {
|
||||||
if self.is_vertical {
|
self.height = height.into();
|
||||||
self.height = height.into();
|
|
||||||
}
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue