mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Moves rendering queue logic from PDFView
This commit is contained in:
parent
7642c39734
commit
a06a974f78
6 changed files with 178 additions and 110 deletions
|
@ -39,6 +39,7 @@ var ThumbnailView = function thumbnailView(container, id, defaultViewport,
|
|||
this.pageHeight = this.viewport.height;
|
||||
this.pageRatio = this.pageWidth / this.pageHeight;
|
||||
this.id = id;
|
||||
this.renderingId = 'thumbnail' + id;
|
||||
|
||||
this.canvasWidth = 98;
|
||||
this.canvasHeight = this.canvasWidth / this.pageWidth * this.pageHeight;
|
||||
|
@ -155,7 +156,7 @@ var ThumbnailView = function thumbnailView(container, id, defaultViewport,
|
|||
canvasContext: ctx,
|
||||
viewport: drawViewport,
|
||||
continueCallback: function(cont) {
|
||||
if (self.renderingQueue.highestPriorityPage !== 'thumbnail' + self.id) {
|
||||
if (!self.renderingQueue.isHighestPriority(self)) {
|
||||
self.renderingState = RenderingStates.PAUSED;
|
||||
self.resume = function() {
|
||||
self.renderingState = RenderingStates.RUNNING;
|
||||
|
@ -336,7 +337,7 @@ var PDFThumbnailViewer = (function pdfThumbnailViewer() {
|
|||
this.thumbnails,
|
||||
this.scroll.down);
|
||||
if (thumbView) {
|
||||
this.renderingQueue.renderView(thumbView, 'thumbnail');
|
||||
this.renderingQueue.renderView(thumbView);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue