From 91692a20d152cbb7300c984a2735f0c5d8a4c333 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 18 Oct 2021 13:41:10 +0200 Subject: [PATCH] Skip the first/last visible pages pre-rendering page layouts with "holes" (PR 14131 follow-up) This was a stupid oversight on my part, since the first/last visible pages have obviously already been rendered at the point when we're checking for any potential "holes" in the page layout. While this will obviously not have any measurable effect on performance, we should nonetheless avoid doing completely unnecessary checks here. --- web/pdf_rendering_queue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pdf_rendering_queue.js b/web/pdf_rendering_queue.js index d08a2e80f..3444a1bec 100644 --- a/web/pdf_rendering_queue.js +++ b/web/pdf_rendering_queue.js @@ -132,7 +132,7 @@ class PDFRenderingQueue { // All the visible views have rendered; try to handle any "holes" in the // page layout (can happen e.g. with spreadModes at higher zoom levels). if (lastId - firstId > 1) { - for (let i = 0, ii = lastId - firstId; i <= ii; i++) { + for (let i = 1, ii = lastId - firstId; i < ii; i++) { const holeId = scrolledDown ? firstId + i : lastId - i, holeView = views[holeId - 1]; if (!this.isViewFinished(holeView)) {