summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/padding.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/src/padding.rs b/core/src/padding.rs
index 083f7eab..6eafd44d 100644
--- a/core/src/padding.rs
+++ b/core/src/padding.rs
@@ -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 {