diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-10-19 17:09:12 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-22 18:17:58 +0200 |
commit | e5a25171fefd917c08e4160435319dd80999999f (patch) | |
tree | 5ad9dccce5cdb35369efa00a77221e76dd42168d /Userland/Libraries/LibGfx | |
parent | 732aa2c5c720cf9ddf35cafe71f4c36e53205e15 (diff) | |
download | serenity-e5a25171fefd917c08e4160435319dd80999999f.zip |
LibGfx: Mark `AffineTransform<T>::map()` as only working for numeric `T`
The implementations for these methods is manually defined in the .cpp
file for `int` and `float`, meaning that other `T` values would fail -
but only once we got to the linking stage. This patch makes the error
happen much earlier, so it's more obvious.
Diffstat (limited to 'Userland/Libraries/LibGfx')
-rw-r--r-- | Userland/Libraries/LibGfx/AffineTransform.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGfx/AffineTransform.h b/Userland/Libraries/LibGfx/AffineTransform.h index f6abcec665..9cdb931219 100644 --- a/Userland/Libraries/LibGfx/AffineTransform.h +++ b/Userland/Libraries/LibGfx/AffineTransform.h @@ -6,6 +6,7 @@ #pragma once +#include <AK/Concepts.h> #include <AK/Format.h> #include <AK/Forward.h> #include <LibGfx/Forward.h> @@ -29,13 +30,13 @@ public: void map(float unmapped_x, float unmapped_y, float& mapped_x, float& mapped_y) const; - template<typename T> + template<Arithmetic T> Point<T> map(Point<T> const&) const; - template<typename T> + template<Arithmetic T> Size<T> map(Size<T> const&) const; - template<typename T> + template<Arithmetic T> Rect<T> map(Rect<T> const&) const; Quad<float> map_to_quad(Rect<float> const&) const; |