diff options
Diffstat (limited to 'otk/size.hh')
| -rw-r--r-- | otk/size.hh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/otk/size.hh b/otk/size.hh index 91539614..57447d5d 100644 --- a/otk/size.hh +++ b/otk/size.hh @@ -2,17 +2,19 @@ #ifndef __size_hh #define __size_hh +#include <cassert> + namespace otk { class Size { - unsigned int _w, _h; + int _w, _h; public: Size() : _w(1), _h(1) {} - Size(unsigned int w, unsigned int h) : _w(w), _h(h) {} - Size(const Size &s) : _w(s._w), _h(s._h) {} + Size(int w, int h) : _w(w), _h(h) { assert(_w >= 0 && _h >= 0); } + Size(const Size &s) : _w(s._w), _h(s._h) { assert(_w >= 0 && _h >= 0); } - inline unsigned int width() const { return _w; } - inline unsigned int height() const { return _h; } + inline int width() const { return _w; } + inline int height() const { return _h; } bool operator==(const Size &o) const { return _w == o._w && _h == o._h; } bool operator!=(const Size &o) const { return _w != o._w || _h != o._h; } |
