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

LibGfx: Add FloatSize::to_int_size()

This commit is contained in:
Andreas Kling 2020-06-10 08:49:41 +02:00
parent 28dcef4757
commit 43951f18e7

View file

@ -35,7 +35,7 @@ namespace Gfx {
class FloatSize {
public:
FloatSize() {}
FloatSize() { }
FloatSize(float w, float h)
: m_width(w)
, m_height(h)
@ -110,6 +110,8 @@ public:
String to_string() const { return String::format("[%gx%g]", m_width, m_height); }
Size to_int_size() const { return Size(width(), height()); }
private:
float m_width { 0 };
float m_height { 0 };