mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibGfx: Add Point::scaled(T) and Rect::scaled(T)
Note that we already have Size::scaled(T). While subjectively providing API symmetry, this is mostly to allow using these methods in templated helpers without caring what the exact underlying type is.
This commit is contained in:
parent
7c4b0b0389
commit
7bc7f376fa
Notes:
sideshowbarker
2024-07-17 07:43:44 +09:00
Author: https://github.com/trflynn89
Commit: 7bc7f376fa
Pull-request: https://github.com/SerenityOS/serenity/pull/20609
Reviewed-by: https://github.com/gmta
2 changed files with 14 additions and 0 deletions
|
@ -91,6 +91,13 @@ public:
|
|||
return point;
|
||||
}
|
||||
|
||||
[[nodiscard]] Point<T> scaled(T dboth) const
|
||||
{
|
||||
Point<T> point = *this;
|
||||
point.scale_by(dboth);
|
||||
return point;
|
||||
}
|
||||
|
||||
[[nodiscard]] Point<T> scaled(Point<T> const& delta) const
|
||||
{
|
||||
Point<T> point = *this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue