diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-09 22:40:47 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-09 22:40:47 +0000 |
| commit | 74cfb1b4c115cdb4e05aa823b09d2b5ea9d0d690 (patch) | |
| tree | 0741de84d1a575abb757c7c3f5e5afc10853453c /otk/size.hh | |
| parent | 9e05db9518c528ac0d2d44311cde267d9886b36a (diff) | |
signed ints instead of unsigned ints again. less pain. pain bad.
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; } |
