Reset touch state before calling onTouchEnd()
In case something calls MainWindow::run() during the execution of this handler. Otherwise it will generate a second touch-end event, on whatever is on the screen at this moment.
This commit is contained in:
+1
-1
@@ -51,8 +51,8 @@ void MainWindow::checkEvents()
|
||||
slidingWindow = nullptr;
|
||||
}
|
||||
else if (touchState.event == TE_UP) {
|
||||
onTouchEnd(touchState.startX + scrollPositionX, touchState.startY + scrollPositionY);
|
||||
touchState.event = TE_NONE;
|
||||
onTouchEnd(touchState.startX + scrollPositionX, touchState.startY + scrollPositionY);
|
||||
}
|
||||
else if (touchState.event == TE_SLIDE) {
|
||||
if (touchState.deltaX || touchState.deltaY) {
|
||||
|
||||
Reference in New Issue
Block a user