Skip to content

Commit

Permalink
Merge pull request #339 from linebender/fromf32
Browse files Browse the repository at this point in the history
Add From (f32, f32) for Point
  • Loading branch information
rsheeter committed Feb 21, 2024
2 parents 13328fb + f8b9a3f commit 7141477
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7141477

Please sign in to comment.