Eink autoscroll dissabled

This commit is contained in:
HarukiToreda 2025-10-06 00:48:17 -04:00
parent 9b57b21ab4
commit 383d95ade1

View File

@ -492,13 +492,14 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
cachedHeights = calculateLineHeights(cachedLines, emotes); cachedHeights = calculateLineHeights(cachedLines, emotes);
// Scrolling logic (unchanged) // Scrolling logic (unchanged)
uint32_t now = millis();
int totalHeight = 0; int totalHeight = 0;
for (size_t i = 0; i < cachedHeights.size(); ++i) for (size_t i = 0; i < cachedHeights.size(); ++i)
totalHeight += cachedHeights[i]; totalHeight += cachedHeights[i];
int usableScrollHeight = usableHeight; int usableScrollHeight = usableHeight;
int scrollStop = std::max(0, totalHeight - usableScrollHeight + cachedHeights.back()); int scrollStop = std::max(0, totalHeight - usableScrollHeight + cachedHeights.back());
#ifndef USE_EINK
uint32_t now = millis();
float delta = (now - lastTime) / 400.0f; float delta = (now - lastTime) / 400.0f;
lastTime = now; lastTime = now;
const float scrollSpeed = 2.0f; const float scrollSpeed = 2.0f;
@ -527,6 +528,13 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
} else { } else {
scrollY = 0; scrollY = 0;
} }
#else
// E-Ink: disable autoscroll
scrollY = 0.0f;
waitingToReset = false;
scrollStarted = false;
lastTime = millis(); // keep timebase sane
#endif
int scrollOffset = static_cast<int>(scrollY); int scrollOffset = static_cast<int>(scrollY);
int yOffset = -scrollOffset + getTextPositions(display)[1]; int yOffset = -scrollOffset + getTextPositions(display)[1];