aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormark9064 <30447455+mark9064@users.noreply.github.com>2024-08-29 16:39:55 +0100
committermark9064 <30447455+mark9064@users.noreply.github.com>2025-10-10 11:42:32 +0100
commit8422923ea0ade3d822eaa40685ad5c465a630bf9 (patch)
tree5f41e0668b7be9cbb4bfbf76279f008b06decf05 /src
parent0881edd2e6404a21224af2667e8becddf188cf24 (diff)
Resolve paint corrupting screen scrolling
Diffstat (limited to 'src')
-rw-r--r--src/displayapp/LittleVgl.cpp4
-rw-r--r--src/displayapp/LittleVgl.h1
-rw-r--r--src/displayapp/screens/InfiniPaint.cpp7
3 files changed, 11 insertions, 1 deletions
diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp
index c6f6f784..f9791c30 100644
--- a/src/displayapp/LittleVgl.cpp
+++ b/src/displayapp/LittleVgl.cpp
@@ -149,6 +149,10 @@ void LittleVgl::SetFullRefresh(FullRefreshDirections direction) {
fullRefresh = true;
}
+bool LittleVgl::IsScrolling() {
+ return scrollDirection != LittleVgl::FullRefreshDirections::None;
+}
+
void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
uint16_t y1, y2, width, height = 0;
diff --git a/src/displayapp/LittleVgl.h b/src/displayapp/LittleVgl.h
index 54505b36..e19c9b56 100644
--- a/src/displayapp/LittleVgl.h
+++ b/src/displayapp/LittleVgl.h
@@ -27,6 +27,7 @@ namespace Pinetime {
void SetNewTouchPoint(int16_t x, int16_t y, bool contact);
void CancelTap();
void ClearTouchState();
+ bool IsScrolling();
bool GetFullRefresh() {
bool returnValue = fullRefresh;
diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp
index 1d6be979..958d7939 100644
--- a/src/displayapp/screens/InfiniPaint.cpp
+++ b/src/displayapp/screens/InfiniPaint.cpp
@@ -61,12 +61,17 @@ bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
}
bool InfiniPaint::OnTouchEvent(uint16_t x, uint16_t y) {
+ // If currently scrolling in or out of InfiniPaint, don't paint anything!
+ // Since InfiniPaint writes directly to the display bypassing LVGL, painting
+ // while scrolling is happening causes bad behaviour
+ if (lvgl.IsScrolling()) {
+ return false;
+ }
lv_area_t area;
area.x1 = x - (width / 2);
area.y1 = y - (height / 2);
area.x2 = x + (width / 2) - 1;
area.y2 = y + (height / 2) - 1;
- lvgl.SetFullRefresh(Components::LittleVgl::FullRefreshDirections::None);
lvgl.FlushDisplay(&area, b);
return true;
}