Add a negation operator for sdl::point.

This commit is contained in:
Tommy 2023-10-24 18:13:53 +13:00
parent c6d9565ed1
commit 18c2ad3bf8

View file

@ -62,6 +62,11 @@ struct point : SDL_Point
return *this;
}
constexpr point operator-() const
{
return {-x, -y};
}
constexpr point operator-(const point& point) const
{
return {x - point.x, y - point.y};