diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-07 14:32:35 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-07 16:19:51 +0200 |
| commit | 1192132dc0a9e991953fd29e93f87c8437a53ea0 (patch) | |
| tree | 67061e75a5a15c7997a3ac2de349b5e9ce234434 /src/eval/layout.rs | |
| parent | eb22eed31b08874fbbbee68d2ae59f0d02f9e95d (diff) | |
Rename length-related types
`Fractional` => `Fraction`
`Relative` => `Ratio`
`Linear` => `Relative`
Diffstat (limited to 'src/eval/layout.rs')
| -rw-r--r-- | src/eval/layout.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/eval/layout.rs b/src/eval/layout.rs index aecc7ef9..f541694c 100644 --- a/src/eval/layout.rs +++ b/src/eval/layout.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use super::{Barrier, StyleChain}; use crate::diag::TypResult; use crate::frame::{Element, Frame, Geometry, Shape, Stroke}; -use crate::geom::{Align, Length, Linear, Paint, Point, Sides, Size, Spec, Transform}; +use crate::geom::{Align, Length, Paint, Point, Relative, Sides, Size, Spec, Transform}; use crate::library::graphics::MoveNode; use crate::library::layout::{AlignNode, PadNode}; use crate::util::Prehashed; @@ -161,7 +161,7 @@ impl LayoutNode { } /// Force a size for this node. - pub fn sized(self, sizing: Spec<Option<Linear>>) -> Self { + pub fn sized(self, sizing: Spec<Option<Relative>>) -> Self { if sizing.any(Option::is_some) { SizedNode { sizing, child: self }.pack() } else { @@ -189,7 +189,7 @@ impl LayoutNode { } /// Pad this node at the sides. - pub fn padded(self, padding: Sides<Linear>) -> Self { + pub fn padded(self, padding: Sides<Relative>) -> Self { if !padding.left.is_zero() || !padding.top.is_zero() || !padding.right.is_zero() @@ -292,7 +292,7 @@ impl Layout for EmptyNode { #[derive(Debug, Hash)] struct SizedNode { /// How to size the node horizontally and vertically. - sizing: Spec<Option<Linear>>, + sizing: Spec<Option<Relative>>, /// The node to be sized. child: LayoutNode, } @@ -314,7 +314,7 @@ impl Layout for SizedNode { .unwrap_or(regions.first); // Select the appropriate base and expansion for the child depending - // on whether it is automatically or linearly sized. + // on whether it is automatically or relatively sized. let is_auto = self.sizing.map_is_none(); let base = is_auto.select(regions.base, size); let expand = regions.expand | !is_auto; |
