From 616619d0d3f8df485d2d9b30b782dd1460d904e2 Mon Sep 17 00:00:00 2001 From: Baris Albayrak Date: Fri, 23 Jan 2026 00:01:29 +1100 Subject: [PATCH] Fix: Preserve page number when rotating screen Previously, rotating the screen would reset the reading position to the beginning of the chapter. This change ensures the current page number is stored and restored after the view re-renders. --- src/activities/reader/EpubReaderActivity.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index 506b6e5e..162c9d53 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -512,6 +512,11 @@ void EpubReaderActivity::rotateScreen() { // We don't want to change orientation mid-render, so grab the semaphore xSemaphoreTake(renderingMutex, portMAX_DELAY); + // If a section is loaded, preserve the current page number + if (section) { + nextPageNumber = section->currentPage; + } + // // Cycle to next orientation //