1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #1223 from arturadib/issue-1186

Fixes #1186 - Race condition due to fast zooming
This commit is contained in:
notmasteryet 2012-02-15 19:13:20 -08:00
commit c5c08888bf

View file

@ -37,10 +37,6 @@ var RenderingQueue = (function RenderingQueueClosure() {
if (!item.drawingRequired())
return; // as no redraw required, no need for queueing.
if ('rendering' in item)
return; // is already in the queue
item.rendering = true;
this.items.push(item);
if (this.items.length > 1)
return; // not first item
@ -49,7 +45,6 @@ var RenderingQueue = (function RenderingQueueClosure() {
},
continueExecution: function RenderingQueueContinueExecution() {
var item = this.items.shift();
delete item.rendering;
if (this.items.length == 0)
return; // queue is empty
@ -869,7 +864,10 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight,
var self = this;
stats.begin = Date.now();
this.content.startRendering(ctx, function pageViewDrawCallback(error) {
div.removeChild(self.loadingIconDiv);
if (self.loadingIconDiv) {
div.removeChild(self.loadingIconDiv);
delete self.loadingIconDiv;
}
if (error)
PDFView.error('An error occurred while rendering the page.', error);
@ -969,7 +967,7 @@ var ThumbnailView = function thumbnailView(container, page, id, pageRatio) {
};
this.setImage = function thumbnailViewSetImage(img) {
if (this.hasImage)
if (this.hasImage || !img)
return;
var ctx = getPageDrawContext();
@ -1207,7 +1205,6 @@ window.addEventListener('scroll', function webViewerScroll(evt) {
updateViewarea();
}, true);
var thumbnailTimer;
function updateThumbViewArea() {