Skip to content

Commit

Permalink
EPUB: Restore position more precisely
Browse files Browse the repository at this point in the history
Calculate based on the end of the range, not the start, because the
start could be on the previous page.
  • Loading branch information
AbeJellinek committed Aug 28, 2024
1 parent 26b6b25 commit 915cf92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom/epub/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 915cf92

Please sign in to comment.