[Scummvm-cvs-logs] CVS: scummvm/common rect.h,1.18,1.19

Max Horn fingolfin at users.sourceforge.net
Thu Mar 4 14:49:13 CET 2004


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32740

Modified Files:
	rect.h 
Log Message:
added Rect::moveTo methods

Index: rect.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/rect.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- rect.h	18 Jan 2004 21:41:38 -0000	1.18
+++ rect.h	4 Mar 2004 22:26:31 -0000	1.19
@@ -78,7 +78,7 @@
 		@return true if the given point is inside this rectangle, false otherwise
 	*/
 	bool contains(const Point & p) const {
-		return (left <= p.x) && (p.x < right) && (top <= p.y) && (p.y < bottom);
+		return contains(p.x, p.y);
 	}
 
 	/*!	@brief check if given rectangle intersects with this rectangle
@@ -137,6 +137,17 @@
 	bool isValidRect() const {
 		return (left <= right && top <= bottom);
 	}
+	
+	void moveTo(int16 x, int16 y) {
+		bottom += y - top;
+		right += x - left;
+		top = y;
+		left = x;
+	}
+	
+	void moveTo(const Point & p) {
+		moveTo(p.x, p.y);
+	}
 };
 
 }	// End of namespace Common





More information about the Scummvm-git-logs mailing list