]> Dogcows Code - chaz/openbox/blobdiff - otk/rect.cc
correct a comment
[chaz/openbox] / otk / rect.cc
index f5068efe3e9fe61057bc53061626c72e1d9f123c..7ec5c2c4487378c36a8ac62d509902d13d8c0ea7 100644 (file)
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
 #include "rect.hh"
 
 namespace otk {
@@ -21,7 +27,7 @@ void Rect::setPos(const Point &location)
   _x2 += location.x() - _x1;
   _x1 = location.x();
   _y2 += location.y() - _y1;
-  _y1 = loaction.y();
+  _y1 = location.y();
 }
 
 
@@ -34,19 +40,19 @@ void Rect::setPos(int x, int y)
 }
 
 
-void Rect::setWidth(unsigned int w)
+void Rect::setWidth(int w)
 {
   _x2 = w + _x1 - 1;
 }
 
 
-void Rect::setHeight(unsigned int h)
+void Rect::setHeight(int h)
 {
   _y2 = h + _y1 - 1;
 }
 
 
-void Rect::setSize(unsigned int w, unsigned int h)
+void Rect::setSize(int w, int h)
 {
   _x2 = w + _x1 - 1;
   _y2 = h + _y1 - 1;
@@ -60,13 +66,13 @@ void Rect::setSize(const Point &size)
 }
 
 
-void Rect::setRect(int x, int y, unsigned int w, unsigned int h)
+void Rect::setRect(int x, int y, int w, int h)
 {
   *this = Rect(x, y, w, h);
 }
 
 
-void setRect(const Point &location, const Point &size)
+void Rect::setRect(const Point &location, const Point &size)
 {
   *this = Rect(location, size);
 }
@@ -81,7 +87,7 @@ void Rect::setCoords(int l, int t, int r, int b)
 }
 
 
-void setCoords(const Point &tl, const Point &br)
+void Rect::setCoords(const Point &tl, const Point &br)
 {
   _x1 = tl.x();
   _y1 = tl.y();
@@ -130,6 +136,12 @@ bool Rect::contains(int x, int y) const
 }
 
 
+bool Rect::contains(const Point &p) const
+{
+  return contains(p.x(), p.y());
+}
+
+
 bool Rect::contains(const Rect& a) const
 {
   return a._x1 >= _x1 && a._x2 <= _x2 &&
This page took 0.023091 seconds and 4 git commands to generate.