Fix ping pong scroll logic

This commit is contained in:
Tomislav Kopić 2024-11-05 19:39:55 +01:00
parent fd3c54d517
commit 3f20df7571

View File

@ -138,7 +138,7 @@ bool fetchPrintingStatus(Adafruit_SSD1306& display) {
display.fillRect(0, 26, displayWidth, 11, BLACK); display.fillRect(0, 26, displayWidth, 11, BLACK);
// Check if its time to scroll based on the delay // Check if its time to scroll based on the delay
if(fileNameWidth > 22) { if(fileNameWidth > displayWidth) {
if (millis() - lastScrollTime > scrollDelay) { if (millis() - lastScrollTime > scrollDelay) {
// Update scroll position based on the current direction // Update scroll position based on the current direction
scrollPos += scrollDirection; scrollPos += scrollDirection;