Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixed so the origin of the touch events is the upper left.
- Loading branch information
Showing
with
5 additions
and
1 deletion.
-
+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); |
|
|