From 915cf9234840b3fe466cafc833dfb81a374b4732 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 28 Aug 2024 12:57:56 -0400 Subject: [PATCH] EPUB: Restore position more precisely Calculate based on the end of the range, not the start, because the start could be on the previous page. --- src/dom/epub/flow.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom/epub/flow.ts b/src/dom/epub/flow.ts index a3ea0977..d736f619 100644 --- a/src/dom/epub/flow.ts +++ b/src/dom/epub/flow.ts @@ -678,11 +678,11 @@ export class PaginatedFlow extends AbstractFlow { true ); if (startRange) { - startRange.collapse(true); + startRange.collapse(false); this._cachedStartRange = new PersistentRange(startRange); } if (startCFIRange) { - startCFIRange.collapse(true); + startCFIRange.collapse(false); this._cachedStartCFI = new EpubCFI(startCFIRange, renderer.section.cfiBase); this._cachedStartCFIOffsetY = 0; }