From 89e479dd6c3aec4b2311a4f8a8e5bd124775bddb Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 7 Dec 2018 12:55:19 +0100 Subject: [PATCH] Tweak the `PDFHistory._tryPushCurrentPosition` method to work better with the different Scroll/Spread viewer modes Given that a larger number of pages may now be visible at once, and importantly that their layout may be non-vertical, one of the conditions should be tweaked to not accidentally miss cases where a page is still visible. Please note: This patch is based on code-inspection, and the only ill effect occurring without it would be a couple of (near) duplicate history entries in some *rare* edge-cases. --- web/pdf_history.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/pdf_history.js b/web/pdf_history.js index 9c7a4de1c..7c02dbe34 100644 --- a/web/pdf_history.js +++ b/web/pdf_history.js @@ -329,8 +329,8 @@ class PDFHistory { } let forceReplace = false; - if (this._destination.page === position.first || - this._destination.page === position.page) { + if (this._destination.page >= position.first && + this._destination.page <= position.page) { // When the `page` of `this._destination` is still visible, do not // update the browsing history when `this._destination` either: // - contains an internal destination, since in this case we