1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 07:17:35 +00:00

LibGfx: Templatize Point, Size, and Rect

This commit is contained in:
Matthew Olsson 2020-07-25 21:31:47 -07:00 committed by Andreas Kling
parent 7a1c328417
commit 335916d8db
33 changed files with 404 additions and 835 deletions

View file

@ -31,14 +31,16 @@
namespace Gfx {
template<>
String IntSize::to_string() const
{
return String::format("[%dx%d]", m_width, m_height);
}
const LogStream& operator<<(const LogStream& stream, const IntSize& value)
template<>
String FloatSize::to_string() const
{
return stream << value.to_string();
return String::format("[%fx%f]", m_width, m_height);
}
}
@ -64,3 +66,6 @@ bool decode(Decoder& decoder, Gfx::IntSize& size)
}
}
template class Gfx::Size<int>;
template class Gfx::Size<float>;