mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #4081 from yurydelendik/doubledraw
Avoiding double draw() calls
This commit is contained in:
commit
a340336269
1 changed files with 5 additions and 0 deletions
|
@ -419,12 +419,17 @@ var PageView = function pageView(container, id, scale,
|
|||
this.draw = function pageviewDraw(callback) {
|
||||
var pdfPage = this.pdfPage;
|
||||
|
||||
if (this.pagePdfPromise) {
|
||||
return;
|
||||
}
|
||||
if (!pdfPage) {
|
||||
var promise = PDFView.getPage(this.id);
|
||||
promise.then(function(pdfPage) {
|
||||
delete this.pagePdfPromise;
|
||||
this.setPdfPage(pdfPage);
|
||||
this.draw(callback);
|
||||
}.bind(this));
|
||||
this.pagePdfPromise = promise;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue