[Scummvm-cvs-logs] SF.net SVN: scummvm: [24591] scummvm/trunk/common/rect.h
cyx at users.sourceforge.net
cyx at users.sourceforge.net
Fri Nov 3 22:04:20 CET 2006
Revision: 24591
http://svn.sourceforge.net/scummvm/?rev=24591&view=rev
Author: cyx
Date: 2006-11-03 13:04:10 -0800 (Fri, 03 Nov 2006)
Log Message:
-----------
added translation method to Common::Rect
Modified Paths:
--------------
scummvm/trunk/common/rect.h
Modified: scummvm/trunk/common/rect.h
===================================================================
--- scummvm/trunk/common/rect.h 2006-11-03 21:03:12 UTC (rev 24590)
+++ scummvm/trunk/common/rect.h 2006-11-03 21:04:10 UTC (rev 24591)
@@ -42,7 +42,7 @@
Point & operator=(const Point & p) { x = p.x; y = p.y; return *this; };
bool operator==(const Point & p) const { return x == p.x && y == p.y; };
bool operator!=(const Point & p) const { return x != p.x || y != p.y; };
-
+
/**
* Return the square of the distance between this point and the point p.
*
@@ -53,7 +53,7 @@
int diffx = ABS(p.x - x);
if (diffx >= 0x1000)
return 0xFFFFFF;
-
+
int diffy = ABS(p.y - y);
if (diffy >= 0x1000)
return 0xFFFFFF;
@@ -185,6 +185,11 @@
left = x;
}
+ void translate(int16 dx, int16 dy) {
+ left += dx; right += dx;
+ top += dy; bottom += dy;
+ }
+
void moveTo(const Point &p) {
moveTo(p.x, p.y);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list