mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Add Neg implementation for Vector2D
This commit is contained in:
parent
d26311e76b
commit
4eaf8af72f
|
@ -1016,6 +1016,14 @@ impl<T: Number> Vector2D<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl <T: Number + Neg<Output = T>> Neg for Vector2D<T> {
|
||||
type Output = Self;
|
||||
|
||||
fn neg(self) -> Self::Output {
|
||||
(-self.x, -self.y).into()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
|
|
Loading…
Reference in a new issue