summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-05-27 14:48:45 +0200
committerLaurenz <laurmaedje@gmail.com>2021-05-27 14:48:45 +0200
commitb886ced40825372000df0fa9cddff98a1b642cc6 (patch)
tree6baf23b24c90352f3712f0e8eda57decf913181a /src/library
parent9e0a34c80f2fa48ada3a0ed0c985c8daa2ae7de3 (diff)
Switch to N64 type alias
Diffstat (limited to 'src/library')
-rw-r--r--src/library/shapes.rs10
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 {