summaryrefslogtreecommitdiff
path: root/src/geom/length.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-06-13 23:16:40 +0200
committerLaurenz <laurmaedje@gmail.com>2022-06-14 13:53:02 +0200
commitc81e2a5f56eb262663f292578c683fba7f18251f (patch)
tree6c045a8dcbec5e75e01a15f970ef8cee6ff042d0 /src/geom/length.rs
parent891af17260a6750a74a102388a05e59cf1ffc3c1 (diff)
Many fixes
Diffstat (limited to 'src/geom/length.rs')
-rw-r--r--src/geom/length.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/geom/length.rs b/src/geom/length.rs
index 96888764..773fd2fd 100644
--- a/src/geom/length.rs
+++ b/src/geom/length.rs
@@ -10,7 +10,7 @@ impl Length {
Self(Scalar(0.0))
}
- /// The inifinite length.
+ /// The infinite length.
pub const fn inf() -> Self {
Self(Scalar(f64::INFINITY))
}
@@ -50,7 +50,7 @@ impl Length {
(self.0).0
}
- /// Get the value of this length in unit.
+ /// Get the value of this length in a unit.
pub fn to_unit(self, unit: LengthUnit) -> f64 {
self.to_raw() / unit.raw_scale()
}
@@ -75,7 +75,7 @@ impl Length {
self.to_unit(LengthUnit::In)
}
- /// The absolute value of the this length.
+ /// The absolute value of this length.
pub fn abs(self) -> Self {
Self::raw(self.to_raw().abs())
}
@@ -100,7 +100,8 @@ impl Length {
*self = (*self).max(other);
}
- /// Whether the other length fits into this one (i.e. is smaller).
+ /// Whether the other length fits into this one (i.e. is smaller). Allows
+ /// for a bit of slack.
pub fn fits(self, other: Self) -> bool {
self.0 + 1e-6 >= other.0
}