Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed so the origin of the touch events is the upper left.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 14, 2010
1 parent 9b3727d commit b8765f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -330,9 +330,13 @@ - (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
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);
Expand Down

0 comments on commit b8765f4

Please sign in to comment.