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:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user