test/testgesture.c
changeset 6790 475f0a544157
parent 5535 96594ac5fd1a
child 6951 7833f01322b3
--- a/test/testgesture.c	Mon Dec 31 13:49:06 2012 -0800
+++ b/test/testgesture.c	Mon Dec 31 14:08:43 2012 -0800
@@ -94,8 +94,8 @@
   int y = (int)_y;
   float a;
   
-  if(x < 0 || x > screen->w) return;
-  if(y < 0 || y > screen->h) return;
+  if(x < 0 || x >= screen->w) return;
+  if(y < 0 || y >= screen->h) return;
 
   pixmem32 = (Uint32*) screen->pixels  + y*screen->pitch/BPP + x;
   
@@ -195,7 +195,7 @@
   if (!window) {
     window = SDL_CreateWindow("Gesture Test",
                               SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
-                              WIDTH, HEIGHT, SDL_WINDOW_RESIZABLE);
+                              width, height, SDL_WINDOW_RESIZABLE);
   }
   if (!window) {
     return NULL;
@@ -257,7 +257,7 @@
 	    break;
 	  case SDL_WINDOWEVENT:
             if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
-	      if (!(screen = initScreen(0, 0)))
+	      if (!(screen = initScreen(event.window.data1, event.window.data2)))
 	      {
 		SDL_Quit();
 		return 1;