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:
parent
7a1c328417
commit
335916d8db
33 changed files with 404 additions and 835 deletions
|
@ -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>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue