summaryrefslogtreecommitdiff
path: root/src/geom/linear.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/geom/linear.rs')
-rw-r--r--src/geom/linear.rs7
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
}