From 83b39a9a3e366d9bc4baadb7c988b874cfe25a08 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 18 Apr 2002 18:11:33 +0000 Subject: added Inflate, Deflate, and Translate to the Rect geometry class --- src/Geometry.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Geometry.h') diff --git a/src/Geometry.h b/src/Geometry.h index cbdf0fd1..0ca914b5 100644 --- a/src/Geometry.h +++ b/src/Geometry.h @@ -99,6 +99,18 @@ public: } bool Intersect(const Rect &r) const; + // returns a rect that is this rect increased in size by the passed in amount + Rect Inflate(const unsigned int i) const; + Rect Inflate(const unsigned int iw, const unsigned int ih) const; + Rect Inflate(const Size &i) const; + // returns a rect that is this rect decreased in size by the passed in amount + Rect Deflate(const unsigned int d) const; + Rect Deflate(const unsigned int dw, const unsigned int dh) const; + Rect Deflate(const Size &d) const; + // returns a rect that is moved the amount specified + Rect Translate(const int t) const; + Rect Translate(const int tx, const int ty) const; + Rect Translate(const Point &t) const; }; #endif // __geometry_h -- cgit v1.2.3