diff options
author | 2021-06-01 19:13:11 +0700 | |
---|---|---|
committer | 2021-06-01 19:13:11 +0700 | |
commit | d83e263abe3458808799e2afca159c2ddab5e10f (patch) | |
tree | da8a9f90a030a64bae267cabc290e318a97ebfab /core | |
parent | fe0a27c56d9d75fb521e69352259f1d737402a20 (diff) | |
download | iced-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.rs | 10 |
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 { |