diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-12 19:16:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-12 19:23:39 +0200 |
commit | 5c780c9ef759465f8ac72585ab857ff3fe9f41bc (patch) | |
tree | abeb7269cf9462fa4d2c83c7b1c8b88bcd26ad42 /Libraries/LibGfx/FloatRect.h | |
parent | dd7796515fe34a80c2d2cce2ff0cc6fde41e02b4 (diff) | |
download | serenity-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.h | 5 |
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; |