From 37ecfaea689e00c858ad79618b0000bf1c2ef3c0 Mon Sep 17 00:00:00 2001 From: Jason P Date: Thu, 12 Jun 2025 09:24:47 -0500 Subject: [PATCH] Don't shift screens when we draw new ones --- src/graphics/Screen.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 4020d5922..229a9ad8b 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -883,6 +883,7 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver) void Screen::setFrames(FrameFocus focus) { uint8_t originalPosition = ui->getUiState()->currentFrame; + uint8_t previousFrameCount = framesetInfo.frameCount; FramesetInfo fsi; // Location of specific frames, for applying focus parameter LOG_DEBUG("Show standard frames"); @@ -1042,11 +1043,14 @@ void Screen::setFrames(FrameFocus focus) break; case FOCUS_PRESERVE: - // No more adjustment — force stay on same index - if (originalPosition < fsi.frameCount) + // No more adjustment — force stay on same index + if (previousFrameCount > fsi.frameCount) { + ui->switchToFrame(originalPosition - 1); + } else if (previousFrameCount < fsi.frameCount) { + ui->switchToFrame(originalPosition + 1); + } else { ui->switchToFrame(originalPosition); - else - ui->switchToFrame(fsi.frameCount - 1); + } break; }