Use correct current page on reader screen

Fixes the page counter not updating
This commit is contained in:
Dave Allie 2025-12-03 22:34:16 +11:00
parent 7704772ebe
commit 2c80aca7b5
No known key found for this signature in database
GPG Key ID: F2FDDB3AD8D0276F
2 changed files with 1 additions and 2 deletions

View File

@ -159,7 +159,7 @@ void EpubReaderScreen::renderPage() {
void EpubReaderScreen::renderStatusBar() const { void EpubReaderScreen::renderStatusBar() const {
const auto pageWidth = renderer->getPageWidth(); const auto pageWidth = renderer->getPageWidth();
std::string progress = std::to_string(currentPage + 1) + " / " + std::to_string(section->pageCount); std::string progress = std::to_string(section->currentPage + 1) + " / " + std::to_string(section->pageCount);
const auto progressTextWidth = renderer->getSmallTextWidth(progress.c_str()); const auto progressTextWidth = renderer->getSmallTextWidth(progress.c_str());
renderer->drawSmallText(pageWidth - progressTextWidth, 765, progress.c_str()); renderer->drawSmallText(pageWidth - progressTextWidth, 765, progress.c_str());

View File

@ -14,7 +14,6 @@ class EpubReaderScreen final : public Screen {
SemaphoreHandle_t sectionMutex = nullptr; SemaphoreHandle_t sectionMutex = nullptr;
int currentSpineIndex = 0; int currentSpineIndex = 0;
int nextPageNumber = 0; int nextPageNumber = 0;
int currentPage = 0;
bool updateRequired = false; bool updateRequired = false;
static void taskTrampoline(void* param); static void taskTrampoline(void* param);