mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
LibGfx: Allow Vector{2,3,4} operators to accept different argument types
This is needed to e.g. multiply a Vector4<f32x4> by a float.
This commit is contained in:
parent
486d2d099c
commit
b07bb85700
3 changed files with 12 additions and 6 deletions
|
@ -60,12 +60,14 @@ public:
|
|||
return Vector2(m_x / other.m_x, m_y / other.m_y);
|
||||
}
|
||||
|
||||
constexpr Vector2 operator*(T f) const
|
||||
template<typename U>
|
||||
constexpr Vector2 operator*(U f) const
|
||||
{
|
||||
return Vector2(m_x * f, m_y * f);
|
||||
}
|
||||
|
||||
constexpr Vector2 operator/(T f) const
|
||||
template<typename U>
|
||||
constexpr Vector2 operator/(U f) const
|
||||
{
|
||||
return Vector2(m_x / f, m_y / f);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue