changeset 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 463cd74304b9
children 494f71f57a80
files src/video/cocoa/SDL_cocoawindow.m
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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);