From c26da073d3baa669a558a3cb07298e057640513f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 13 Aug 2010 17:05:06 -0700 Subject: [PATCH] Fixed so the origin of the touch events is the upper left. --- src/video/cocoa/SDL_cocoawindow.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 656964bd5..04fd0874b 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -330,9 +330,13 @@ static __inline__ void ConvertNSRect(NSRect *r) 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);