diff --git a/core/src/mouse/cursor.rs b/core/src/mouse/cursor.rs index 7acf6c7d..3e1d2bf4 100644 --- a/core/src/mouse/cursor.rs +++ b/core/src/mouse/cursor.rs @@ -89,6 +89,20 @@ impl std::ops::Add for Cursor { } } +impl std::ops::Sub for Cursor { + type Output = Self; + + fn sub(self, translation: Vector) -> Self::Output { + match self { + Cursor::Available(point) => Cursor::Available(point - translation), + Cursor::Levitating(point) => { + Cursor::Levitating(point - translation) + } + Cursor::Unavailable => Cursor::Unavailable, + } + } +} + impl std::ops::Mul for Cursor { type Output = Self;