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:
Raphael Coeffic
2021-05-27 22:27:58 +02:00
parent a3923c35b9
commit ff35b89543
+1 -1
View File
@@ -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) {