Fixed the off-by-one bug in SDL_RecursivelyCalculateShapeTree().
authoregottlieb
Fri, 06 Aug 2010 13:52:38 -0400
changeset 4836 7eb8ca721a5b
parent 4835 40b5293d0598
child 4837 2e446923c9fb
Fixed the off-by-one bug in SDL_RecursivelyCalculateShapeTree().
src/video/SDL_shape.c
--- a/src/video/SDL_shape.c	Thu Aug 05 21:27:32 2010 -0400
+++ b/src/video/SDL_shape.c	Fri Aug 06 13:52:38 2010 -0400
@@ -168,13 +168,13 @@
 				next.x = dimensions.x;
 				next.y = dimensions.y;
 				result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next);
-				next.x = dimensions.w / 2 + 1;
+				next.x = dimensions.w / 2;
 				//Unneeded: next.y = dimensions.y;
 				result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next);
 				next.x = dimensions.x;
-				next.y = dimensions.h / 2 + 1;
+				next.y = dimensions.h / 2;
 				result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next);
-				next.x = dimensions.w / 2 + 1;
+				next.x = dimensions.w / 2;
 				//Unneeded: next.y = dimensions.h / 2 + 1;
 				result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,invert,next);
 				return result;