mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 07:38:07 +02:00
Actually skip pages included in the skipPages
array when running tests, rather than creating empty 1x1 canvases (issue 8241)
Considering how extremely simple this patch turned out to be, I'm almost worried that I completely misunderstood why the current code looks like it does...
This commit is contained in:
parent
a662d26814
commit
9d62ff80ca
1 changed files with 3 additions and 12 deletions
|
@ -446,18 +446,9 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
|
|||
|
||||
if (task.skipPages && task.skipPages.indexOf(task.pageNum) >= 0) {
|
||||
this._log(' Skipping page ' + task.pageNum + '/' +
|
||||
task.pdfDoc.numPages + '... ');
|
||||
|
||||
// Empty the canvas
|
||||
this.canvas.width = 1;
|
||||
this.canvas.height = 1;
|
||||
ctx = this.canvas.getContext('2d', {alpha: false});
|
||||
ctx.save();
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillRect(0, 0, 1, 1);
|
||||
ctx.restore();
|
||||
|
||||
this._snapshot(task, '');
|
||||
task.pdfDoc.numPages + '...\n');
|
||||
task.pageNum++;
|
||||
this._nextPage(task);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue