summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@lich.io>2021-06-01 19:13:11 +0700
committerLibravatar Héctor Ramón <hector@lich.io>2021-06-01 19:13:11 +0700
commitd83e263abe3458808799e2afca159c2ddab5e10f (patch)
treeda8a9f90a030a64bae267cabc290e318a97ebfab /core
parentfe0a27c56d9d75fb521e69352259f1d737402a20 (diff)
downloadiced-d83e263abe3458808799e2afca159c2ddab5e10f.tar.gz
iced-d83e263abe3458808799e2afca159c2ddab5e10f.tar.bz2
iced-d83e263abe3458808799e2afca159c2ddab5e10f.zip
Introduce `vertical` and `horizontal` methods to `Padding`
Diffstat (limited to 'core')
-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 {