1
0
Fork 0
forked from len0rd/rockbox

[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
This commit is contained in:
William Wilgus 2025-03-08 12:30:18 -05:00 committed by Solomon Peachy
parent dec8d4101d
commit fffae07833

View file

@ -148,6 +148,7 @@ bool LCDFN(scroll_now)(struct scrollinfo *s)
} }
else else
{ {
s->backward = false; /* bugfix we only account for forward scrolling here */
snprintf(line_buf, sizeof(line_buf)-1, "%s%s%s", snprintf(line_buf, sizeof(line_buf)-1, "%s%s%s",
s->linebuffer, " ", s->linebuffer); s->linebuffer, " ", s->linebuffer);
s->line = line_buf; s->line = line_buf;