[Scummvm-cvs-logs] CVS: scummvm/common rect.h,1.16,1.17
Max Horn
fingolfin at users.sourceforge.net
Wed Jan 7 19:25:00 CET 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.97,1.98 bomp.cpp,2.15,2.16 charset.cpp,2.81,2.82 costume.cpp,1.125,1.126 gfx.cpp,2.257,2.258 gfx.h,1.57,1.58 object.cpp,1.156,1.157 script_v8.cpp,2.220,2.221
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.98,1.99 charset.cpp,2.82,2.83 debugger.cpp,1.110,1.111 gfx.cpp,2.258,2.259 object.cpp,1.157,1.158 scumm.h,1.349,1.350 verbs.cpp,1.90,1.91
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv29360
Modified Files:
rect.h
Log Message:
useful convenience method
Index: rect.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/rect.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- rect.h 6 Jan 2004 12:45:28 -0000 1.16
+++ rect.h 8 Jan 2004 03:24:01 -0000 1.17
@@ -100,11 +100,26 @@
bottom = MAX(bottom, r.bottom);
}
+ /*! @brief extend this rectangle in all four directions by the given number of pixels
+
+ @param offset the size to grow by
+ */
void grow(int16 offset) {
top -= offset;
left -= offset;
bottom += offset;
right += offset;
+ }
+
+ void clip(const Rect & r) {
+ if (top < r.top) top = r.top;
+ if (left < r.left) left = r.left;
+ if (bottom > r.bottom) bottom = r.bottom;
+ if (right > r.right) right = r.right;
+ }
+
+ void clip(int maxw, int maxh) {
+ clip(Rect(0, 0, maxw, maxh));
}
};
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.97,1.98 bomp.cpp,2.15,2.16 charset.cpp,2.81,2.82 costume.cpp,1.125,1.126 gfx.cpp,2.257,2.258 gfx.h,1.57,1.58 object.cpp,1.156,1.157 script_v8.cpp,2.220,2.221
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.98,1.99 charset.cpp,2.82,2.83 debugger.cpp,1.110,1.111 gfx.cpp,2.258,2.259 object.cpp,1.157,1.158 scumm.h,1.349,1.350 verbs.cpp,1.90,1.91
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list