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;
|
break;
|
||||||
}
|
}
|
||||||
else if (c >= 0xFE) {
|
else if (c >= 0xFE) {
|
||||||
|
// CJK char
|
||||||
s++;
|
s++;
|
||||||
c = uint8_t(*s) + ((c & 0x01) << 8) - 1;
|
c = uint8_t(*s) + ((c & 0x01) << 8) - 1;
|
||||||
if (c >= 0x101)
|
if (c >= 0x101)
|
||||||
|
|||||||
+9
-4
@@ -53,10 +53,15 @@ void MainWindow::checkEvents()
|
|||||||
onTouchEnd(touchState.startX + scrollPositionX, touchState.startY + scrollPositionY);
|
onTouchEnd(touchState.startX + scrollPositionX, touchState.startY + scrollPositionY);
|
||||||
touchState.event = TE_NONE;
|
touchState.event = TE_NONE;
|
||||||
}
|
}
|
||||||
else if (touchState.event == TE_SLIDE && (touchState.deltaX || touchState.deltaY)) {
|
else if (touchState.event == TE_SLIDE) {
|
||||||
onTouchSlide(touchState.x, touchState.y, touchState.startX, touchState.startY, touchState.deltaX, touchState.deltaY);
|
if (touchState.deltaX) {
|
||||||
touchState.deltaX = 0;
|
onTouchSlide(touchState.x, touchState.y, touchState.startX, touchState.startY, touchState.deltaX, 0);
|
||||||
touchState.deltaY = 0;
|
touchState.deltaX = 0;
|
||||||
|
}
|
||||||
|
else if (touchState.deltaY) {
|
||||||
|
onTouchSlide(touchState.x, touchState.y, touchState.startX, touchState.startY, 0, touchState.deltaY);
|
||||||
|
touchState.deltaY = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
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) {
|
for (auto it = children.rbegin(); it != children.rend(); ++it) {
|
||||||
auto child = *it;
|
auto child = *it;
|
||||||
if (child->rect.contains(startX, startY)) {
|
if (child->rect.contains(startX, startY)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user