Some more fixes related to scrolling

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent ba6f3dd9a2
commit 49ba2e46b2
2 changed files with 3 additions and 19 deletions
-16
View File
@@ -562,22 +562,6 @@ bool Window::onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY,
} }
} }
if (slidingWindow && slidingWindow != this) {
return false;
}
if (slideY && innerHeight > rect.h) {
setScrollPositionY(scrollPositionY - slideY);
slidingWindow = this;
return true;
}
if (slideX && innerWidth > rect.w) {
setScrollPositionX(scrollPositionX - slideX);
slidingWindow = this;
return true;
}
return false; return false;
} }
#endif #endif
+3 -3
View File
@@ -215,7 +215,7 @@ class Window
if (windowFlags & FORWARD_SCROLL) if (windowFlags & FORWARD_SCROLL)
innerHeight = value; innerHeight = value;
else if (innerHeight <= value) { else if (innerHeight <= value) {
setScrollPositionY(0); lv_obj_scroll_to_y(lvobj, 0, LV_ANIM_OFF);
} }
invalidate(); invalidate();
} }
@@ -325,12 +325,12 @@ class Window
parent->adjustInnerHeight(); parent->adjustInnerHeight();
} }
else if (height() >= h) { else if (height() >= h) {
setScrollPositionY(0); lv_obj_scroll_to_y(lvobj, 0, LV_ANIM_OFF);
} }
else { else {
coord_t maxScrollPosition = h - height(); coord_t maxScrollPosition = h - height();
if (scrollPositionY > maxScrollPosition) { if (scrollPositionY > maxScrollPosition) {
setScrollPositionY(maxScrollPosition); lv_obj_scroll_to_y(lvobj, maxScrollPosition, LV_ANIM_OFF);
} }
} }
invalidate(); invalidate();