diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-26 13:49:44 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-26 13:49:44 +0200 |
| commit | a9869c212f7c1bc77a52e301ad014641b014e834 (patch) | |
| tree | 97b5d6c71940e903482ba2f30cbcedd8f1c17ea3 /src/eval/ops.rs | |
| parent | 66d8f4569a9f13270c5f477e0730f127a22333e2 (diff) | |
Locatable groups
Diffstat (limited to 'src/eval/ops.rs')
| -rw-r--r-- | src/eval/ops.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/eval/ops.rs b/src/eval/ops.rs index b3f2f3b4..f88f3cee 100644 --- a/src/eval/ops.rs +++ b/src/eval/ops.rs @@ -2,7 +2,7 @@ use std::cmp::Ordering; -use super::{Dynamic, RawAlign, RawLength, RawStroke, Smart, StrExt, Value}; +use super::{RawAlign, RawLength, RawStroke, Smart, StrExt, Value}; use crate::diag::StrResult; use crate::geom::{Numeric, Relative, Spec, SpecAxis}; use crate::model; @@ -94,10 +94,10 @@ pub fn add(lhs: Value, rhs: Value) -> StrResult<Value> { (Dict(a), Dict(b)) => Dict(a + b), (Color(color), Length(thickness)) | (Length(thickness), Color(color)) => { - Dyn(Dynamic::new(RawStroke { + Value::dynamic(RawStroke { paint: Smart::Custom(color.into()), thickness: Smart::Custom(thickness), - })) + }) } (Dyn(a), Dyn(b)) => { @@ -106,10 +106,10 @@ pub fn add(lhs: Value, rhs: Value) -> StrResult<Value> { (a.downcast::<RawAlign>(), b.downcast::<RawAlign>()) { if a.axis() != b.axis() { - Dyn(Dynamic::new(match a.axis() { + Value::dynamic(match a.axis() { SpecAxis::Horizontal => Spec { x: a, y: b }, SpecAxis::Vertical => Spec { x: b, y: a }, - })) + }) } else { return Err(format!("cannot add two {:?} alignments", a.axis())); } |
