From 92c01da36016e94ff20163806ddcbcf7e33d4031 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 10 Oct 2020 22:19:36 +0200 Subject: =?UTF-8?q?Switch=20back=20to=20custom=20geometry=20types,=20unifi?= =?UTF-8?q?ed=20with=20layout=20primitives=20=F0=9F=8F=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eval/value.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/eval/value.rs') diff --git a/src/eval/value.rs b/src/eval/value.rs index c4b11ebe..56dadfc3 100644 --- a/src/eval/value.rs +++ b/src/eval/value.rs @@ -6,7 +6,7 @@ use std::rc::Rc; use super::{Args, Dict, Eval, EvalContext, SpannedEntry}; use crate::color::RgbaColor; -use crate::geom::Linear; +use crate::geom::{Length, Linear, Relative}; use crate::syntax::{Ident, SynTree}; /// A computational value. @@ -23,14 +23,9 @@ pub enum Value { /// A floating-point number: `1.2, 200%`. Float(f64), /// A length: `2cm, 5.2in`. - Length(f64), + Length(Length), /// A relative value: `50%`. - /// - /// _Note_: `50%` is represented as `0.5` here, but as `50.0` in the - /// corresponding [literal]. - /// - /// [literal]: ../syntax/ast/enum.Lit.html#variant.Percent - Relative(f64), + Relative(Relative), /// A combination of an absolute length and a relative value: `20% + 5cm`. Linear(Linear), /// A color value with alpha channel: `#f79143ff`. -- cgit v1.2.3