From 4eaf8af72f35825f96c9509d05a0f81b5f01564c Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 22 Sep 2022 21:32:36 +0100 Subject: [PATCH] Add Neg implementation for Vector2D --- agb-fixnum/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agb-fixnum/src/lib.rs b/agb-fixnum/src/lib.rs index 5d72541..99aa5d3 100644 --- a/agb-fixnum/src/lib.rs +++ b/agb-fixnum/src/lib.rs @@ -1016,6 +1016,14 @@ impl Vector2D { } } +impl > Neg for Vector2D { + type Output = Self; + + fn neg(self) -> Self::Output { + (-self.x, -self.y).into() + } +} + #[cfg(test)] mod tests {