summaryrefslogtreecommitdiff
path: root/Widgets/Size.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-12 12:29:58 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-12 12:29:58 +0200
commite23ac5601741441fea916f605a562d11c9982baa (patch)
tree639f927b9877daa52d2a003413e63974cea58f58 /Widgets/Size.h
parent73895ce043fcd4eeb6f84645dc1b46ca58788e62 (diff)
downloadserenity-e23ac5601741441fea916f605a562d11c9982baa.zip
Add a Painter::drawBitmap() and make Painter::drawText() use it.
Diffstat (limited to 'Widgets/Size.h')
-rw-r--r--Widgets/Size.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/Widgets/Size.h b/Widgets/Size.h
new file mode 100644
index 0000000000..a50e7b3086
--- /dev/null
+++ b/Widgets/Size.h
@@ -0,0 +1,20 @@
+#pragma once
+
+class Size {
+public:
+ Size() { }
+ Size(int w, int h) : m_width(w), m_height(h) { }
+
+ bool isEmpty() const { return !m_width || !m_height; }
+
+ int width() const { return m_width; }
+ int height() const { return m_height; }
+
+ void setWidth(int w) { m_width = w; }
+ void setHeight(int h) { m_height = h; }
+
+private:
+ int m_width { 0 };
+ int m_height { 0 };
+};
+