diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-11-17 14:51:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-11-17 14:51:31 +0100 |
| commit | 4d0bdc4ca4cb5e8ca1a70b38a0fc0ec37d9e4857 (patch) | |
| tree | ce30d2b3d3709c2c248e3e8f31696d69c9db0f09 /src/layout/mod.rs | |
| parent | 1f009b5b95cbc31fb0a05a7f72ee6f5f53ece19a (diff) | |
Axes updating for flex layouter 📐
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9bb91956..420c90bc 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -202,20 +202,20 @@ impl LayoutAxes { /// the layouting axes, that is: /// - The x coordinate describes the primary axis instead of the horizontal one. /// - The y coordinate describes the secondary axis instead of the vertical one. - pub fn generalize(&self, space: Size2D) -> Size2D { + pub fn generalize(&self, size: Size2D) -> Size2D { if self.primary.axis.is_horizontal() { - space + size } else { - Size2D { x: space.y, y: space.x } + Size2D { x: size.y, y: size.x } } } /// Returns the specialized version of this generalized Size2D. /// (Inverse to `generalized`). - pub fn specialize(&self, space: Size2D) -> Size2D { + pub fn specialize(&self, size: Size2D) -> Size2D { // In fact, generalized is its own inverse. For reasons of clarity // at the call site, we still have this second function. - self.generalize(space) + self.generalize(size) } /// The position of the anchor specified by the two aligned axes |
