Scroll issues

This commit is contained in:
Bertrand Songis
2020-03-11 11:50:24 +01:00
parent db61c7c7b8
commit 91d00309ed
3 changed files with 13 additions and 4 deletions
+1
View File
@@ -509,6 +509,7 @@ coord_t BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_
break;
}
else if (c >= 0xFE) {
// CJK char
s++;
c = uint8_t(*s) + ((c & 0x01) << 8) - 1;
if (c >= 0x101)
+9 -4
View File
@@ -53,10 +53,15 @@ void MainWindow::checkEvents()
onTouchEnd(touchState.startX + scrollPositionX, touchState.startY + scrollPositionY);
touchState.event = TE_NONE;
}
else if (touchState.event == TE_SLIDE && (touchState.deltaX || touchState.deltaY)) {
onTouchSlide(touchState.x, touchState.y, touchState.startX, touchState.startY, touchState.deltaX, touchState.deltaY);
touchState.deltaX = 0;
touchState.deltaY = 0;
else if (touchState.event == TE_SLIDE) {
if (touchState.deltaX) {
onTouchSlide(touchState.x, touchState.y, touchState.startX, touchState.startY, touchState.deltaX, 0);
touchState.deltaX = 0;
}
else if (touchState.deltaY) {
onTouchSlide(touchState.x, touchState.y, touchState.startX, touchState.startY, 0, touchState.deltaY);
touchState.deltaY = 0;
}
}
#endif
+3
View File
@@ -362,6 +362,9 @@ bool Window::onTouchEnd(coord_t x, coord_t y)
bool Window::onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY, coord_t slideX, coord_t slideY)
{
startX += getScrollPositionX();
startY += getScrollPositionY();
for (auto it = children.rbegin(); it != children.rend(); ++it) {
auto child = *it;
if (child->rect.contains(startX, startY)) {