diff src/video/cocoa/SDL_cocoawindow.m @ 4687:257bdf117af8

Fixed so the origin of the touch events is the upper left.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 13 Aug 2010 17:05:06 -0700
parents 229529693289
children 7b1d35d98294
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoawindow.m	Sat Aug 07 11:35:24 2010 -0400
+++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Aug 13 17:05:06 2010 -0700
@@ -330,9 +330,13 @@
                 return;
             }
         } 
+
+        SDL_FingerID fingerId = (SDL_FingerID)[touch identity];
         float x = [touch normalizedPosition].x;
         float y = [touch normalizedPosition].y;
-        SDL_FingerID fingerId = (SDL_FingerID)[touch identity];
+	/* Make the origin the upper left instead of the lower left */
+	y = 1.0f - y;
+
         switch (type) {
         case COCOA_TOUCH_DOWN:
             SDL_SendFingerDown(touchId, fingerId, SDL_TRUE, x, y, 1);