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

LibGfx: Give Size and Rect * and *= operators

This commit is contained in:
Nico Weber 2020-12-18 11:15:38 -05:00 committed by Andreas Kling
parent b67eed5b80
commit 573d5b7ff2
2 changed files with 18 additions and 0 deletions

View file

@ -98,6 +98,15 @@ public:
return *this;
}
Size<T> operator*(T factor) const { return { m_width * factor, m_height * factor }; }
Size<T>& operator*=(T factor)
{
m_width *= factor;
m_height *= factor;
return *this;
}
T primary_size_for_orientation(Orientation orientation) const
{
return orientation == Orientation::Vertical ? height() : width();