Scroll issues
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user