Accumulate (slideX, slideY) with touch slide events.

Apparently, onTouchSlide gets called more frequently, and hence we miss some of the sliding if we do not accumulate between calls to Lua.
This commit is contained in:
jfrickmann
2021-07-26 21:34:38 -04:00
parent cbced4a81c
commit d4e02dbc22
+4 -2
View File
@@ -482,6 +482,8 @@ void LuaWidget::refresh(BitmapBuffer* dc)
if (swiped)
swipeTimeOut = get_tmr10ms() + EVT_TOUCH_SWIPE_TIMEOUT;
}
slideX = 0;
slideY = 0;
}
} else
#endif
@@ -584,8 +586,8 @@ bool LuaWidget::onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t start
touchY = y;
LuaWidget::startX = startX;
LuaWidget::startY = startY;
LuaWidget::slideX = slideX;
LuaWidget::slideY = slideY;
LuaWidget::slideX += slideX;
LuaWidget::slideY += slideY;
lastTouchDown = 0;
return true;