X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Frect.cpp;h=8c9c74ed70c949ef22a49553afe150f9de021f77;hb=ccac11461956c9c0cc9756f8963436b5d88dfbb7;hp=8207f234a3f397915c25344649462d02896971ac;hpb=3f1e5ba1d42ab40edf75cf05df16b0e25d0821cb;p=architektonas diff --git a/src/rect.cpp b/src/rect.cpp index 8207f23..8c9c74e 100644 --- a/src/rect.cpp +++ b/src/rect.cpp @@ -98,3 +98,33 @@ void Rect::Expand(double amt) b -= amt; } + +double Rect::Width(void) +{ + return r - l; +} + + +double Rect::Height(void) +{ + return t - b; +} + + +bool Rect::Contains(Point p) +{ + return ((p.x >= l) && (p.x <= r) && (p.y >= b) && (p.y <= t) ? true : false); +} + + +Point Rect::TopLeft(void) +{ + return Point(t, l); +} + + +Point Rect::BottomRight(void) +{ + return Point(b, r); +} +