Fixed so the origin of the touch events is the upper left.
authorSam Lantinga <slouken@libsdl.org>
Fri, 13 Aug 2010 17:05:06 -0700
changeset 4687 257bdf117af8
parent 4686 463cd74304b9
child 4688 494f71f57a80
Fixed so the origin of the touch events is the upper left.
src/video/cocoa/SDL_cocoawindow.m
--- 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);