X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Frect.h;fp=src%2Frect.h;h=0a8478a6b47cc461d80eb408777d3148018dc18c;hb=e78daf62eb771ee29a59035d16cf63c1e6ebe144;hp=0000000000000000000000000000000000000000;hpb=0fcc2d879e1e0ca17eeaceae2159f5143a06586f;p=architektonas diff --git a/src/rect.h b/src/rect.h new file mode 100644 index 0000000..0a8478a --- /dev/null +++ b/src/rect.h @@ -0,0 +1,26 @@ +#ifndef __RECT_H__ +#define __RECT_H__ + +// +// We're doing this because the Qt implementation is non-Cartesian compliant. +// Also, it auto-normalizes rects constructed using the constructors. :-) +// + +#include "vector.h" + +struct Rect +{ + double l, r, t, b; + + Rect(); + Rect(double ll, double rr, double tt, double bb); + Rect(Point tl, Point br); + Rect & operator*=(double scale); + Rect & operator|=(Rect x); + void Normalize(void); + void Translate(Point p); + void Expand(double amt); +}; + +#endif // __RECT_H__ +