From da940929232a7b9caef381d546cde0dc34c15e22 Mon Sep 17 00:00:00 2001 From: octocorvus Date: Fri, 16 Aug 2024 15:03:10 +0000 Subject: [PATCH] do not reset scroll after page change --- viewer/js/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/viewer/js/index.js b/viewer/js/index.js index 1565f13e..13d245e0 100644 --- a/viewer/js/index.js +++ b/viewer/js/index.js @@ -58,15 +58,12 @@ function doPrerender(pageNumber, prerenderTrigger) { } } -function display(newCanvas, zoom) { +function display(newCanvas) { canvas.height = newCanvas.height; canvas.width = newCanvas.width; canvas.style.height = newCanvas.style.height; canvas.style.width = newCanvas.style.width; canvas.getContext("2d", { alpha: false }).drawImage(newCanvas, 0, 0); - if (!zoom) { - scrollTo(0, 0); - } } function setLayerTransform(pageWidth, pageHeight, layerDiv) { @@ -101,7 +98,7 @@ function renderPage(pageNumber, zoom, prerender, prerenderTrigger=0) { cache.splice(i, 1); cache.push(cached); - display(cached.canvas, zoom); + display(cached.canvas); textLayerDiv.replaceWith(cached.textLayerDiv); textLayerDiv = cached.textLayerDiv; @@ -179,7 +176,7 @@ function renderPage(pageNumber, zoom, prerender, prerenderTrigger=0) { if (!useRender || rendered) { return; } - display(newCanvas, zoom); + display(newCanvas); rendered = true; } render();