summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx/FloatRect.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-12 19:16:27 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-12 19:23:39 +0200
commit5c780c9ef759465f8ac72585ab857ff3fe9f41bc (patch)
treeabeb7269cf9462fa4d2c83c7b1c8b88bcd26ad42 /Libraries/LibGfx/FloatRect.h
parentdd7796515fe34a80c2d2cce2ff0cc6fde41e02b4 (diff)
downloadserenity-5c780c9ef759465f8ac72585ab857ff3fe9f41bc.zip
LibGfx: Allow constructing Float{Rect,Point,Size} from integer buddies
Diffstat (limited to 'Libraries/LibGfx/FloatRect.h')
-rw-r--r--Libraries/LibGfx/FloatRect.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibGfx/FloatRect.h b/Libraries/LibGfx/FloatRect.h
index 4b08043db2..39caf90e03 100644
--- a/Libraries/LibGfx/FloatRect.h
+++ b/Libraries/LibGfx/FloatRect.h
@@ -56,6 +56,11 @@ public:
{
}
+ explicit FloatRect(const Rect& other)
+ : FloatRect((FloatPoint)other.location(), (FloatSize)other.size())
+ {
+ }
+
bool is_null() const
{
return width() == 0 && height() == 0;