diff options
| author | Martin Haug <mhaug@live.de> | 2022-04-30 21:59:34 +0200 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-05-01 11:50:34 +0200 |
| commit | 5f1499d380e223e7e1b2a8a96eb99e3ec95a56ac (patch) | |
| tree | 44945bc35618c9ce10380016200309e42c2b5ed4 /src/model/styles.rs | |
| parent | f9e115daf54c29358f890b137f50a33a781af680 (diff) | |
Add round corners and change arguments
Diffstat (limited to 'src/model/styles.rs')
| -rw-r--r-- | src/model/styles.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/styles.rs b/src/model/styles.rs index eb7a7053..2e752625 100644 --- a/src/model/styles.rs +++ b/src/model/styles.rs @@ -459,6 +459,22 @@ where } } +impl<T> Fold for Sides<Option<T>> +where + T: Default, +{ + type Output = Sides<T>; + + fn fold(self, outer: Self::Output) -> Self::Output { + Sides { + left: self.left.unwrap_or(outer.left), + right: self.right.unwrap_or(outer.right), + top: self.top.unwrap_or(outer.top), + bottom: self.bottom.unwrap_or(outer.bottom), + } + } +} + /// A scoped property barrier. /// /// Barriers interact with [scoped](StyleMap::scoped) styles: A scoped style |
