mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibGfx: Add unary operator-()
to Vector2/3/4
This commit is contained in:
parent
27ca7bbbd7
commit
53ed93d909
Notes:
sideshowbarker
2024-07-17 20:58:35 +09:00
Author: https://github.com/Quaker762 Commit: https://github.com/SerenityOS/serenity/commit/53ed93d9095 Pull-request: https://github.com/SerenityOS/serenity/pull/11905 Reviewed-by: https://github.com/BertalanD Reviewed-by: https://github.com/IdanHo ✅ Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/sunverwerth ✅
@ -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);
|
||||
|
@ -55,6 +55,11 @@ public:
|
||||
return Vector3(m_x - other.m_x, m_y - other.m_y, m_z - other.m_z);
|
||||
}
|
||||
|
||||
constexpr Vector3 operator-() const
|
||||
{
|
||||
return Vector3(-m_x, -m_y, -m_z);
|
||||
}
|
||||
|
||||
constexpr Vector3 operator*(const Vector3& other) const
|
||||
{
|
||||
return Vector3(m_x * other.m_x, m_y * other.m_y, m_z * other.m_z);
|
||||
|
@ -60,6 +60,11 @@ public:
|
||||
return Vector4(m_x - other.m_x, m_y - other.m_y, m_z - other.m_z, m_w - other.m_w);
|
||||
}
|
||||
|
||||
constexpr Vector4 operator-() const
|
||||
{
|
||||
return Vector4(-m_x, -m_y, -m_z, -m_w);
|
||||
}
|
||||
|
||||
constexpr Vector4 operator*(const Vector4& other) const
|
||||
{
|
||||
return Vector4(m_x * other.m_x, m_y * other.m_y, m_z * other.m_z, m_w * other.m_w);
|
||||
|
Loading…
Reference in New Issue
Block a user