[Scummvm-cvs-logs] scummvm master -> 57abb8f8439e9f8aeaf584a0d7b2e6407f09ea3c

clone2727 clone2727 at gmail.com
Thu Mar 22 05:39:57 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
57abb8f843 COMMON: Make Rect::center() more readable


Commit: 57abb8f8439e9f8aeaf584a0d7b2e6407f09ea3c
    https://github.com/scummvm/scummvm/commit/57abb8f8439e9f8aeaf584a0d7b2e6407f09ea3c
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-03-21T21:38:12-07:00

Commit Message:
COMMON: Make Rect::center() more readable

Thanks to Fingolfin for the suggestion

Changed paths:
    common/rect.h



diff --git a/common/rect.h b/common/rect.h
index 50ef020..2bd3aff 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -247,9 +247,8 @@ struct Rect {
 	 * @note the center point is rounded up and left when given an odd width and height
 	 */
 	static Rect center(int16 cx, int16 cy, int16 w, int16 h) {
-		int dx = w / 2;
-		int dy = h / 2;
-		return Rect(cx - dx, cy - dy, cx + dx + (w & 1), cy + dy + (h & 1));
+		int x = cx - w / 2, y = cy - h / 2;
+		return Rect(x, y, x + w, y + h);
 	}
 };
 






More information about the Scummvm-git-logs mailing list