summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/vector.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/vector.rs b/core/src/vector.rs
index 1c09ee3e..75c77dbd 100644
--- a/core/src/vector.rs
+++ b/core/src/vector.rs
@@ -32,6 +32,17 @@ where
}
}
+impl<T> std::ops::Mul for Vector<T>
+where
+ T: std::ops::Mul<Output = T>,
+{
+ type Output = Self;
+
+ fn mul(self, b: Self) -> Self {
+ Self::new(self.x * b.x, self.y * b.y)
+ }
+}
+
impl<T> Default for Vector<T>
where
T: Default,