diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-21 19:08:47 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-21 19:08:47 +0200 |
| commit | c0377de653ed7c0ae0e253724cbbb622125fbd3f (patch) | |
| tree | d69237f632084f07ce04e6d877cdea451a03f295 /src/layout/constraints.rs | |
| parent | 0dd4ae0a7ac0c247078df492469ff20b8a90c886 (diff) | |
Shorter/clearer field name for geometry types
Size { width, height } => Size { w, h }
Spec { horizontal, vertical } => Spec { x, y }
Gen { cross, main } => Gen { inline, block }
Diffstat (limited to 'src/layout/constraints.rs')
| -rw-r--r-- | src/layout/constraints.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/layout/constraints.rs b/src/layout/constraints.rs index d808abd9..f88b2add 100644 --- a/src/layout/constraints.rs +++ b/src/layout/constraints.rs @@ -52,11 +52,11 @@ impl Constraints { /// Set the appropriate base constraints for linear width and height sizing. pub fn set_base_if_linear(&mut self, base: Size, sizing: Spec<Option<Linear>>) { // The full sizes need to be equal if there is a relative component in the sizes. - if sizing.horizontal.map_or(false, |l| l.is_relative()) { - self.base.horizontal = Some(base.width); + if sizing.x.map_or(false, |l| l.is_relative()) { + self.base.x = Some(base.w); } - if sizing.vertical.map_or(false, |l| l.is_relative()) { - self.base.vertical = Some(base.height); + if sizing.y.map_or(false, |l| l.is_relative()) { + self.base.y = Some(base.h); } } } |
