From f8b9a3f3b99fa7906f70529008c455715587e2c8 Mon Sep 17 00:00:00 2001 From: rsheeter Date: Wed, 21 Feb 2024 12:16:51 -0800 Subject: [PATCH] Add From (f32, f32) for Point --- src/point.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/point.rs b/src/point.rs index 84baf6c7..3e618b0b 100644 --- a/src/point.rs +++ b/src/point.rs @@ -187,6 +187,16 @@ impl Point { } } +impl From<(f32, f32)> for Point { + #[inline] + fn from(v: (f32, f32)) -> Point { + Point { + x: v.0 as f64, + y: v.1 as f64, + } + } +} + impl From<(f64, f64)> for Point { #[inline] fn from(v: (f64, f64)) -> Point {