diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-12 12:29:58 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-12 12:29:58 +0200 |
commit | e23ac5601741441fea916f605a562d11c9982baa (patch) | |
tree | 639f927b9877daa52d2a003413e63974cea58f58 /Widgets/Size.h | |
parent | 73895ce043fcd4eeb6f84645dc1b46ca58788e62 (diff) | |
download | serenity-e23ac5601741441fea916f605a562d11c9982baa.zip |
Add a Painter::drawBitmap() and make Painter::drawText() use it.
Diffstat (limited to 'Widgets/Size.h')
-rw-r--r-- | Widgets/Size.h | 20 |
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 }; +}; + |