Prevent touch from leaking out of window
This has some bizzare results if allowed
This commit is contained in:
parent
0f4de4b5f7
commit
9b9d3e42b2
|
@ -397,13 +397,22 @@ void EventThread::process(RGSSThreadData &rtData)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_FINGERDOWN :
|
case SDL_FINGERDOWN :
|
||||||
|
if (event.tfinger.x * winW > rtData.screenOffset.x &&
|
||||||
|
event.tfinger.x * winW < winW - rtData.screenOffset.x) {
|
||||||
i = event.tfinger.fingerId;
|
i = event.tfinger.fingerId;
|
||||||
touchState.fingers[i].down = true;
|
touchState.fingers[i].down = true;
|
||||||
|
touchState.fingers[i].x = event.tfinger.x * winW;
|
||||||
|
touchState.fingers[i].y = event.tfinger.y * winH;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case SDL_FINGERMOTION :
|
case SDL_FINGERMOTION :
|
||||||
|
if (event.tfinger.x * winW > rtData.screenOffset.x &&
|
||||||
|
event.tfinger.x * winW < winW - rtData.screenOffset.x) {
|
||||||
i = event.tfinger.fingerId;
|
i = event.tfinger.fingerId;
|
||||||
touchState.fingers[i].x = event.tfinger.x * winW;
|
touchState.fingers[i].x = event.tfinger.x * winW;
|
||||||
touchState.fingers[i].y = event.tfinger.y * winH;
|
touchState.fingers[i].y = event.tfinger.y * winH;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_FINGERUP :
|
case SDL_FINGERUP :
|
||||||
|
|
Loading…
Reference in New Issue