Introduce vertical and horizontal methods to Padding

This commit is contained in:
Héctor Ramón 2021-06-01 19:13:11 +07:00
parent fe0a27c56d
commit d83e263abe

View File

@ -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 {