Fix scroller draining off-screen on low frame rates

The scroller recycled at most one line per frame while movement was
continuous (velocity * dt), so whenever a frame's displacement exceeded
one line height the text block drifted toward the boundary and the
screen drained with nothing replacing it. This surfaced on slower
hardware / 60Hz panels (|move| > lineHeight) but not on fast machines.

Recycle in a loop until every line that scrolled fully off-screen has a
replacement, for both scroll directions. addLineAt() now returns whether
a line was produced so the loop stops cleanly instead of losing lines.
This commit is contained in:
NeilClack
2026-08-13 16:57:39 -05:00
parent 1c14c0401e
commit 515056a92c
2 changed files with 22 additions and 15 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ private:
void destroyResources();
void rebuildWordTextures();
void prefillLines();
void addLineAt(float baseY);
bool addLineAt(float baseY);
void advanceStream();
void switchAudioForCurrentStream();
void updateAutoVelocity(float dt);