Introduce vertical and horizontal methods to Padding
This commit is contained in:
parent
fe0a27c56d
commit
d83e263abe
1 changed files with 10 additions and 0 deletions
|
|
@ -29,6 +29,16 @@ impl Padding {
|
|||
left: padding,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the total amount of vertical [`Padding`].
|
||||
pub fn vertical(self) -> u16 {
|
||||
self.top + self.bottom
|
||||
}
|
||||
|
||||
/// Returns the total amount of horizontal [`Padding`].
|
||||
pub fn horizontal(self) -> u16 {
|
||||
self.left + self.right
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::From<u16> for Padding {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue