From 88685c24cc750f3a19e9a8794c29b4e70bc9a198 Mon Sep 17 00:00:00 2001 From: Adam Chalmers Date: Mon, 18 Sep 2023 10:16:28 -0500 Subject: [PATCH] More conversions --- src/wasm-lib/kcl/src/std/sketch.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wasm-lib/kcl/src/std/sketch.rs b/src/wasm-lib/kcl/src/std/sketch.rs index 8400eaee7..f4f99def2 100644 --- a/src/wasm-lib/kcl/src/std/sketch.rs +++ b/src/wasm-lib/kcl/src/std/sketch.rs @@ -416,14 +416,14 @@ pub enum AngledLineToData { /// An angle and point with a tag. AngleWithTag { /// The angle of the line. - angle: f64, + angle: Angle, /// The point to draw to. to: f64, /// The tag. tag: String, }, /// An angle and point to draw to. - AngleAndPoint([f64; 2]), + AngleAndPoint(Angle, f64), } /// Draw an angled line to a given x coordinate. @@ -446,11 +446,11 @@ fn inner_angled_line_to_x( let from = sketch_group.get_coords_from_paths()?; let (angle, x_to) = match &data { AngledLineToData::AngleWithTag { angle, to, .. } => (*angle, *to), - AngledLineToData::AngleAndPoint(angle_and_to) => (angle_and_to[0], angle_and_to[1]), + AngledLineToData::AngleAndPoint(angle, to) => (*angle, *to), }; let x_component = x_to - from.x; - let y_component = x_component * f64::tan(angle.to_radians()); + let y_component = x_component * f64::tan(angle.radians()); let y_to = from.y + y_component; let new_sketch_group = inner_line_to( @@ -523,11 +523,11 @@ fn inner_angled_line_to_y( let from = sketch_group.get_coords_from_paths()?; let (angle, y_to) = match &data { AngledLineToData::AngleWithTag { angle, to, .. } => (*angle, *to), - AngledLineToData::AngleAndPoint(angle_and_to) => (angle_and_to[0], angle_and_to[1]), + AngledLineToData::AngleAndPoint(angle, to) => (*angle, *to), }; let y_component = y_to - from.y; - let x_component = y_component / f64::tan(angle.to_radians()); + let x_component = y_component / f64::tan(angle.radians()); let x_to = from.x + x_component; let new_sketch_group = inner_line_to(