summaryrefslogtreecommitdiff
path: root/src/length.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-03 15:07:57 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-03 15:07:57 +0200
commit95bae5725cf6495644e2593f8492f1cd0e5bd3c1 (patch)
tree919dd90cac7623bcbbc09d9c92399eaa65e537f2 /src/length.rs
parent0fc25d732d7cbc37cf801645849d1060f2cec4a3 (diff)
Int, Float, Relative and Linear values 🍉
Diffstat (limited to 'src/length.rs')
-rw-r--r--src/length.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/length.rs b/src/length.rs
index fb62763e..437c741d 100644
--- a/src/length.rs
+++ b/src/length.rs
@@ -177,38 +177,6 @@ impl Display for ParseLengthError {
}
}
-/// Either an absolute length or a factor of some entity.
-#[derive(Copy, Clone, PartialEq)]
-pub enum ScaleLength {
- Absolute(Length),
- Scaled(f64),
-}
-
-impl ScaleLength {
- /// Use the absolute value or scale the entity.
- pub fn raw_scaled(&self, entity: f64) -> f64 {
- match *self {
- ScaleLength::Absolute(l) => l.as_raw(),
- ScaleLength::Scaled(s) => s * entity,
- }
- }
-}
-
-impl Display for ScaleLength {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- match self {
- ScaleLength::Absolute(length) => write!(f, "{}", length),
- ScaleLength::Scaled(scale) => write!(f, "{}%", scale * 100.0),
- }
- }
-}
-
-impl Debug for ScaleLength {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- Display::fmt(self, f)
- }
-}
-
#[cfg(test)]
mod tests {
use super::*;