Mercurial > sdl-ios-xcode
comparison src/video/cocoa/SDL_cocoawindow.m @ 4687:257bdf117af8
Fixed so the origin of the touch events is the upper left.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 13 Aug 2010 17:05:06 -0700 |
parents | 229529693289 |
children | 7b1d35d98294 |
comparison
equal
deleted
inserted
replaced
4686:463cd74304b9 | 4687:257bdf117af8 |
---|---|
328 | 328 |
329 if (SDL_AddTouch(&touch, "") < 0) { | 329 if (SDL_AddTouch(&touch, "") < 0) { |
330 return; | 330 return; |
331 } | 331 } |
332 } | 332 } |
333 | |
334 SDL_FingerID fingerId = (SDL_FingerID)[touch identity]; | |
333 float x = [touch normalizedPosition].x; | 335 float x = [touch normalizedPosition].x; |
334 float y = [touch normalizedPosition].y; | 336 float y = [touch normalizedPosition].y; |
335 SDL_FingerID fingerId = (SDL_FingerID)[touch identity]; | 337 /* Make the origin the upper left instead of the lower left */ |
338 y = 1.0f - y; | |
339 | |
336 switch (type) { | 340 switch (type) { |
337 case COCOA_TOUCH_DOWN: | 341 case COCOA_TOUCH_DOWN: |
338 SDL_SendFingerDown(touchId, fingerId, SDL_TRUE, x, y, 1); | 342 SDL_SendFingerDown(touchId, fingerId, SDL_TRUE, x, y, 1); |
339 break; | 343 break; |
340 case COCOA_TOUCH_UP: | 344 case COCOA_TOUCH_UP: |