mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-24 13:58:09 +00:00
Don't shift screens when we draw new ones
This commit is contained in:
parent
5ae70db247
commit
37ecfaea68
@ -883,6 +883,7 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
|
|||||||
void Screen::setFrames(FrameFocus focus)
|
void Screen::setFrames(FrameFocus focus)
|
||||||
{
|
{
|
||||||
uint8_t originalPosition = ui->getUiState()->currentFrame;
|
uint8_t originalPosition = ui->getUiState()->currentFrame;
|
||||||
|
uint8_t previousFrameCount = framesetInfo.frameCount;
|
||||||
FramesetInfo fsi; // Location of specific frames, for applying focus parameter
|
FramesetInfo fsi; // Location of specific frames, for applying focus parameter
|
||||||
|
|
||||||
LOG_DEBUG("Show standard frames");
|
LOG_DEBUG("Show standard frames");
|
||||||
@ -1043,10 +1044,13 @@ void Screen::setFrames(FrameFocus focus)
|
|||||||
|
|
||||||
case FOCUS_PRESERVE:
|
case FOCUS_PRESERVE:
|
||||||
// No more adjustment — force stay on same index
|
// No more adjustment — force stay on same index
|
||||||
if (originalPosition < fsi.frameCount)
|
if (previousFrameCount > fsi.frameCount) {
|
||||||
|
ui->switchToFrame(originalPosition - 1);
|
||||||
|
} else if (previousFrameCount < fsi.frameCount) {
|
||||||
|
ui->switchToFrame(originalPosition + 1);
|
||||||
|
} else {
|
||||||
ui->switchToFrame(originalPosition);
|
ui->switchToFrame(originalPosition);
|
||||||
else
|
}
|
||||||
ui->switchToFrame(fsi.frameCount - 1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user