From 3a8339fecef37c1cc831be11536847fcde0ca7f3 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 7 Apr 2020 15:36:46 -0400 Subject: [PATCH] Allow dividing a Vector2F by an f32 value. --- geometry/src/vector.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/geometry/src/vector.rs b/geometry/src/vector.rs index a2031e25..6bd754c2 100644 --- a/geometry/src/vector.rs +++ b/geometry/src/vector.rs @@ -246,6 +246,14 @@ impl Div for Vector2F { } } +impl Div for Vector2F { + type Output = Vector2F; + #[inline] + fn div(self, other: f32) -> Vector2F { + self / Vector2F::splat(other) + } +} + impl Neg for Vector2F { type Output = Vector2F; #[inline]