Merge pull request #14096 from Snuffleupagus/spreadMode-preRender

Pre-render *one* additional page when spreadModes are enabled
This commit is contained in:
Tim van der Meij 2021-10-02 12:54:19 +02:00 committed by GitHub
commit dedff3c982
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 16 deletions

View file

@ -1250,10 +1250,16 @@ class BaseViewer {
const scrollAhead = this._isScrollModeHorizontal
? this.scroll.right
: this.scroll.down;
const preRenderExtra =
this._scrollMode === ScrollMode.VERTICAL &&
this._spreadMode !== SpreadMode.NONE &&
!this.isInPresentationMode;
const pageView = this.renderingQueue.getHighestPriority(
visiblePages,
this._pages,
scrollAhead
scrollAhead,
preRenderExtra
);
if (pageView) {
this._ensurePdfPageLoaded(pageView).then(() => {