summaryrefslogtreecommitdiff
path: root/otk/size.hh
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-09 22:40:47 +0000
committerDana Jansens <danakj@orodu.net>2003-02-09 22:40:47 +0000
commit74cfb1b4c115cdb4e05aa823b09d2b5ea9d0d690 (patch)
tree0741de84d1a575abb757c7c3f5e5afc10853453c /otk/size.hh
parent9e05db9518c528ac0d2d44311cde267d9886b36a (diff)
signed ints instead of unsigned ints again. less pain. pain bad.
Diffstat (limited to 'otk/size.hh')
-rw-r--r--otk/size.hh12
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; }