new ScratchCanvas -> createScratchCanvas and fix linting
This commit is contained in:
parent
261ff39f6d
commit
f80fd13fe5
@ -70,7 +70,7 @@ var CanvasExtraState = (function CanvasExtraStateClosure() {
|
|||||||
return CanvasExtraState;
|
return CanvasExtraState;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function ScratchCanvas(width, height) {
|
function createScratchCanvas(width, height) {
|
||||||
var canvas = document.createElement('canvas');
|
var canvas = document.createElement('canvas');
|
||||||
canvas.width = width;
|
canvas.width = width;
|
||||||
canvas.height = height;
|
canvas.height = height;
|
||||||
@ -1115,7 +1115,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
// scale the image to the unit square
|
// scale the image to the unit square
|
||||||
ctx.scale(1 / w, -1 / h);
|
ctx.scale(1 / w, -1 / h);
|
||||||
|
|
||||||
var tmpCanvas = new ScratchCanvas(w, h);
|
var tmpCanvas = createScratchCanvas(w, h);
|
||||||
var tmpCtx = tmpCanvas.getContext('2d');
|
var tmpCtx = tmpCanvas.getContext('2d');
|
||||||
|
|
||||||
var fillColor = this.current.fillColor;
|
var fillColor = this.current.fillColor;
|
||||||
@ -1146,7 +1146,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
// scale the image to the unit square
|
// scale the image to the unit square
|
||||||
ctx.scale(1 / w, -1 / h);
|
ctx.scale(1 / w, -1 / h);
|
||||||
|
|
||||||
var tmpCanvas = new ScratchCanvas(w, h);
|
var tmpCanvas = createScratchCanvas(w, h);
|
||||||
var tmpCtx = tmpCanvas.getContext('2d');
|
var tmpCtx = tmpCanvas.getContext('2d');
|
||||||
this.putBinaryImageData(tmpCtx, imgData, w, h);
|
this.putBinaryImageData(tmpCtx, imgData, w, h);
|
||||||
|
|
||||||
|
@ -756,8 +756,8 @@ var PDFDoc = (function PDFDocClosure() {
|
|||||||
file = new Stream(file, 0, file.length, fontFileDict);
|
file = new Stream(file, 0, file.length, fontFileDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
// At this point, only the font object is created but the font is not
|
// At this point, only the font object is created but the font is
|
||||||
// yet attached to the DOM. This is done in `FontLoader.bind`.
|
// not yet attached to the DOM. This is done in `FontLoader.bind`.
|
||||||
var font = new Font(name, file, properties);
|
var font = new Font(name, file, properties);
|
||||||
this.objs.resolve(id, font);
|
this.objs.resolve(id, font);
|
||||||
break;
|
break;
|
||||||
@ -787,7 +787,7 @@ var PDFDoc = (function PDFDocClosure() {
|
|||||||
var size = width * height;
|
var size = width * height;
|
||||||
var rgbaLength = size * 4;
|
var rgbaLength = size * 4;
|
||||||
var buf = new Uint8Array(size * components);
|
var buf = new Uint8Array(size * components);
|
||||||
var tmpCanvas = new ScratchCanvas(width, height);
|
var tmpCanvas = createScratchCanvas(width, height);
|
||||||
var tmpCtx = tmpCanvas.getContext('2d');
|
var tmpCtx = tmpCanvas.getContext('2d');
|
||||||
tmpCtx.drawImage(img, 0, 0);
|
tmpCtx.drawImage(img, 0, 0);
|
||||||
var data = tmpCtx.getImageData(0, 0, width, height).data;
|
var data = tmpCtx.getImageData(0, 0, width, height).data;
|
||||||
|
@ -222,7 +222,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||||||
width = height = MAX_PATTERN_SIZE;
|
width = height = MAX_PATTERN_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmpCanvas = new ScratchCanvas(width, height);
|
var tmpCanvas = createScratchCanvas(width, height);
|
||||||
|
|
||||||
// set the new canvas element context as the graphics context
|
// set the new canvas element context as the graphics context
|
||||||
var tmpCtx = tmpCanvas.getContext('2d');
|
var tmpCtx = tmpCanvas.getContext('2d');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user