Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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

  • Loading branch information
slouken committed Aug 14, 2010
1 parent 9b3727d commit b8765f4b8648fc6de7cbf791b439a46637f4fae5
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/video/cocoa/SDL_cocoawindow.m
@@ -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);

0 comments on commit b8765f4

Please sign in to comment.