mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Disables rAF for the printing.
This commit is contained in:
parent
00f3756d02
commit
dd07ef9c6a
1 changed files with 7 additions and 1 deletions
|
@ -740,6 +740,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|||
this.commonObjs,
|
||||
intentState.operatorList,
|
||||
this.pageNumber);
|
||||
internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print';
|
||||
if (!intentState.renderTasks) {
|
||||
intentState.renderTasks = [];
|
||||
}
|
||||
|
@ -1555,6 +1556,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
|||
this.running = false;
|
||||
this.graphicsReadyCallback = null;
|
||||
this.graphicsReady = false;
|
||||
this.useRequestAnimationFrame = false;
|
||||
this.cancelled = false;
|
||||
this.capability = createPromiseCapability();
|
||||
this.task = new RenderTask(this);
|
||||
|
@ -1628,7 +1630,11 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
|||
},
|
||||
|
||||
_scheduleNext: function InternalRenderTask__scheduleNext() {
|
||||
window.requestAnimationFrame(this._nextBound);
|
||||
if (this.useRequestAnimationFrame) {
|
||||
window.requestAnimationFrame(this._nextBound);
|
||||
} else {
|
||||
Promise.resolve(undefined).then(this._nextBound);
|
||||
}
|
||||
},
|
||||
|
||||
_next: function InternalRenderTask__next() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue