mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
LibGfx+Userland: Rename Size::scaled_by to Size::scaled
Ignoring Size for a second, we currently have: Rect::scale_by Rect::scaled Point::scale_by Point::scaled In Size, before this patch, we have: Size::scale_by Size::scaled_by This aligns Size to use the same method name as Rect and Point. While subjectively providing API symmetry, this is mostly to allow using this method in templated helpers without caring what the exact underlying type is.
This commit is contained in:
parent
f34cc0b8e3
commit
7c4b0b0389
4 changed files with 7 additions and 7 deletions
|
@ -58,21 +58,21 @@ public:
|
|||
ALWAYS_INLINE constexpr void scale_by(T dboth) { scale_by(dboth, dboth); }
|
||||
ALWAYS_INLINE constexpr void scale_by(Point<T> const& s) { scale_by(s.x(), s.y()); }
|
||||
|
||||
[[nodiscard]] constexpr Size scaled_by(T dx, T dy) const
|
||||
[[nodiscard]] constexpr Size scaled(T dx, T dy) const
|
||||
{
|
||||
Size<T> size = *this;
|
||||
size.scale_by(dx, dy);
|
||||
return size;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Size scaled_by(T dboth) const
|
||||
[[nodiscard]] constexpr Size scaled(T dboth) const
|
||||
{
|
||||
Size<T> size = *this;
|
||||
size.scale_by(dboth);
|
||||
return size;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr Size scaled_by(Point<T> const& s) const
|
||||
[[nodiscard]] constexpr Size scaled(Point<T> const& s) const
|
||||
{
|
||||
Size<T> size = *this;
|
||||
size.scale_by(s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue