mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Reduce the number of calls to PDFView.getVisiblePages from updateViewarea
This commit is contained in:
parent
2acb40fffb
commit
b88c5330a9
1 changed files with 4 additions and 3 deletions
|
@ -1205,14 +1205,15 @@ var PDFView = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
renderHighestPriority: function pdfViewRenderHighestPriority() {
|
renderHighestPriority:
|
||||||
|
function pdfViewRenderHighestPriority(currentlyVisiblePages) {
|
||||||
if (PDFView.idleTimeout) {
|
if (PDFView.idleTimeout) {
|
||||||
clearTimeout(PDFView.idleTimeout);
|
clearTimeout(PDFView.idleTimeout);
|
||||||
PDFView.idleTimeout = null;
|
PDFView.idleTimeout = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pages have a higher priority than thumbnails, so check them first.
|
// Pages have a higher priority than thumbnails, so check them first.
|
||||||
var visiblePages = this.getVisiblePages();
|
var visiblePages = currentlyVisiblePages || this.getVisiblePages();
|
||||||
var pageView = this.getHighestPriority(visiblePages, this.pages,
|
var pageView = this.getHighestPriority(visiblePages, this.pages,
|
||||||
this.pageViewScroll.down);
|
this.pageViewScroll.down);
|
||||||
if (pageView) {
|
if (pageView) {
|
||||||
|
@ -1925,7 +1926,7 @@ function updateViewarea() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PDFView.renderHighestPriority();
|
PDFView.renderHighestPriority(visible);
|
||||||
|
|
||||||
var currentId = PDFView.page;
|
var currentId = PDFView.page;
|
||||||
var firstPage = visible.first;
|
var firstPage = visible.first;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue