diff options
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/shapes.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/library/shapes.rs b/src/library/shapes.rs index 05cc2e2d..a47203c4 100644 --- a/src/library/shapes.rs +++ b/src/library/shapes.rs @@ -1,6 +1,6 @@ use std::f64::consts::SQRT_2; -use decorum::NotNan; +use decorum::N64; use super::*; use crate::color::Color; @@ -49,14 +49,14 @@ pub fn square(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { let height = width.is_none().then(|| args.eat_named(ctx, "height")).flatten(); let fill = args.eat_named(ctx, "fill"); let body = args.eat::<TemplateValue>(ctx).unwrap_or_default(); - rect_impl("square", width, height, Some(1.0.into()), fill, body) + rect_impl("square", width, height, Some(N64::from(1.0)), fill, body) } fn rect_impl( name: &str, width: Option<Linear>, height: Option<Linear>, - aspect: Option<NotNan<f64>>, + aspect: Option<N64>, fill: Option<Color>, body: TemplateValue, ) -> Value { @@ -121,14 +121,14 @@ pub fn circle(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { let height = width.is_none().then(|| args.eat_named(ctx, "height")).flatten(); let fill = args.eat_named(ctx, "fill"); let body = args.eat::<TemplateValue>(ctx).unwrap_or_default(); - ellipse_impl("circle", width, height, Some(1.0.into()), fill, body) + ellipse_impl("circle", width, height, Some(N64::from(1.0)), fill, body) } fn ellipse_impl( name: &str, width: Option<Linear>, height: Option<Linear>, - aspect: Option<NotNan<f64>>, + aspect: Option<N64>, fill: Option<Color>, body: TemplateValue, ) -> Value { |
