1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:17:44 +00:00

LibGfx: Add unary operator-() to Vector2/3/4

This commit is contained in:
Jesse Buhagiar 2022-01-15 13:01:08 +11:00 committed by Idan Horowitz
parent 27ca7bbbd7
commit 53ed93d909
3 changed files with 15 additions and 0 deletions

View file

@ -50,6 +50,11 @@ public:
return Vector2(m_x - other.m_x, m_y - other.m_y);
}
constexpr Vector2 operator-() const
{
return Vector2(-m_x, -m_y);
}
constexpr Vector2 operator*(const Vector2& other) const
{
return Vector2(m_x * other.m_x, m_y * other.m_y);