From 43951f18e75d119a8e7c29327155d6b5eb493745 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 10 Jun 2020 08:49:41 +0200 Subject: [PATCH] LibGfx: Add FloatSize::to_int_size() --- Libraries/LibGfx/FloatSize.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/LibGfx/FloatSize.h b/Libraries/LibGfx/FloatSize.h index 02638e5058..c513b921ce 100644 --- a/Libraries/LibGfx/FloatSize.h +++ b/Libraries/LibGfx/FloatSize.h @@ -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 };