]> Shamusworld >> Repos - architektonas/blobdiff - src/rect.cpp
Added ability to manipulate Text objects.
[architektonas] / src / rect.cpp
index 8207f234a3f397915c25344649462d02896971ac..8c9c74ed70c949ef22a49553afe150f9de021f77 100644 (file)
@@ -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);
+}
+