From 5c780c9ef759465f8ac72585ab857ff3fe9f41bc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 12 Apr 2020 19:16:27 +0200 Subject: LibGfx: Allow constructing Float{Rect,Point,Size} from integer buddies --- Libraries/LibGfx/FloatRect.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Libraries/LibGfx/FloatRect.h') 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; -- cgit v1.2.3