diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-10 22:35:24 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-10 22:35:24 +0200 |
| commit | 51bf3268ddf5db1bdd61e59bfb4a30f0463a4bfb (patch) | |
| tree | 9da15f6e77e714f5f983e60159cecd6d37cd7cf2 /src/geom | |
| parent | 92c01da36016e94ff20163806ddcbcf7e33d4031 (diff) | |
Refactor text state 🆎
Diffstat (limited to 'src/geom')
| -rw-r--r-- | src/geom/linear.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/geom/linear.rs b/src/geom/linear.rs index 2567d264..d9860d43 100644 --- a/src/geom/linear.rs +++ b/src/geom/linear.rs @@ -11,7 +11,10 @@ pub struct Linear { impl Linear { /// The zero linear. - pub const ZERO: Linear = Linear { rel: Relative::ZERO, abs: Length::ZERO }; + pub const ZERO: Self = Self { rel: Relative::ZERO, abs: Length::ZERO }; + + /// The linear with a relative part of `100%` and no absolute part. + pub const ONE: Self = Self { rel: Relative::ONE, abs: Length::ZERO }; /// Create a new linear. pub fn new(rel: Relative, abs: Length) -> Self { @@ -24,7 +27,7 @@ impl Linear { self.rel.eval(one) + self.abs } - /// Whether this linear's relative component is zero. + /// Whether this linear's relative part is zero. pub fn is_absolute(self) -> bool { self.rel == Relative::ZERO } |
