From 2bbd395d5dcdf9c92ffb354b8b05444478e4b344 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 6 Jan 2020 18:44:45 +0100 Subject: Draft `styling` example --- core/src/vector.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core') 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 std::ops::Mul for Vector +where + T: std::ops::Mul, +{ + type Output = Self; + + fn mul(self, b: Self) -> Self { + Self::new(self.x * b.x, self.y * b.y) + } +} + impl Default for Vector where T: Default, -- cgit