diff options
Diffstat (limited to 'src/length.rs')
| -rw-r--r-- | src/length.rs | 32 |
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::*; |
