Fixed so the origin of the touch events is the upper left.
This commit is contained in:
parent
ef04c29fdd
commit
c26da073d3
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue