From fffae078333a9826ddc30777738bf03abd135410 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 8 Mar 2025 12:30:18 -0500 Subject: [PATCH] [Bugfix] Scroll engine, backwards scrolling causes display corruption When a line is over a selected length bi-directional scrolling is disabled. In non bidir scrolling the string is copied to a buffer twice with a space between "scroll text" + " " + "scroll text" this is to allow scrolling the line in the forward direction with minimal extra logic Note: that is the ONLY direction it is equiped to handle In the USB screen I observed while switching through the different modes that sometimes the text was corrupted turns out you can still have scroll->backwards set to true which causes offset to go negatve but we never check if offset < 0 in non bidir scrolling mode and happily continue with ever more negative offsets Change-Id: I210f7880be953d3cc42469828a7ca5fc2b2ab96f --- firmware/drivers/lcd-scroll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/drivers/lcd-scroll.c b/firmware/drivers/lcd-scroll.c index 14789be64a..ca52476b87 100644 --- a/firmware/drivers/lcd-scroll.c +++ b/firmware/drivers/lcd-scroll.c @@ -148,6 +148,7 @@ bool LCDFN(scroll_now)(struct scrollinfo *s) } else { + s->backward = false; /* bugfix we only account for forward scrolling here */ snprintf(line_buf, sizeof(line_buf)-1, "%s%s%s", s->linebuffer, " ", s->linebuffer); s->line = line_buf;