From d83e263abe3458808799e2afca159c2ddab5e10f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Date: Tue, 1 Jun 2021 19:13:11 +0700 Subject: Introduce `vertical` and `horizontal` methods to `Padding` --- core/src/padding.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core') 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 for Padding { -- cgit