Fixed so the origin of the touch events is the upper left.

This commit is contained in:
Sam Lantinga 2010-08-13 17:05:06 -07:00
parent ef04c29fdd
commit c26da073d3

View file

@ -330,9 +330,13 @@ static __inline__ void ConvertNSRect(NSRect *r)
return; return;
} }
} }
SDL_FingerID fingerId = (SDL_FingerID)[touch identity];
float x = [touch normalizedPosition].x; float x = [touch normalizedPosition].x;
float y = [touch normalizedPosition].y; 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) { switch (type) {
case COCOA_TOUCH_DOWN: case COCOA_TOUCH_DOWN:
SDL_SendFingerDown(touchId, fingerId, SDL_TRUE, x, y, 1); SDL_SendFingerDown(touchId, fingerId, SDL_TRUE, x, y, 1);