From: Julian Viereck Date: Thu, 23 Feb 2012 14:46:00 +0000 (+0100) Subject: new ScratchCanvas -> createScratchCanvas and fix linting X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f80fd13fe5c6f893914f173ffa7f140d38de1fe8;p=pdf.js.git new ScratchCanvas -> createScratchCanvas and fix linting --- diff --git a/src/canvas.js b/src/canvas.js index db1461a..7fb85f1 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -70,7 +70,7 @@ var CanvasExtraState = (function CanvasExtraStateClosure() { return CanvasExtraState; })(); -function ScratchCanvas(width, height) { +function createScratchCanvas(width, height) { var canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height; @@ -1115,7 +1115,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { // scale the image to the unit square ctx.scale(1 / w, -1 / h); - var tmpCanvas = new ScratchCanvas(w, h); + var tmpCanvas = createScratchCanvas(w, h); var tmpCtx = tmpCanvas.getContext('2d'); var fillColor = this.current.fillColor; @@ -1146,7 +1146,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { // scale the image to the unit square ctx.scale(1 / w, -1 / h); - var tmpCanvas = new ScratchCanvas(w, h); + var tmpCanvas = createScratchCanvas(w, h); var tmpCtx = tmpCanvas.getContext('2d'); this.putBinaryImageData(tmpCtx, imgData, w, h); diff --git a/src/core.js b/src/core.js index b62302a..16b7ee1 100644 --- a/src/core.js +++ b/src/core.js @@ -756,8 +756,8 @@ var PDFDoc = (function PDFDocClosure() { file = new Stream(file, 0, file.length, fontFileDict); } - // At this point, only the font object is created but the font is not - // yet attached to the DOM. This is done in `FontLoader.bind`. + // At this point, only the font object is created but the font is + // not yet attached to the DOM. This is done in `FontLoader.bind`. var font = new Font(name, file, properties); this.objs.resolve(id, font); break; @@ -787,7 +787,7 @@ var PDFDoc = (function PDFDocClosure() { var size = width * height; var rgbaLength = size * 4; var buf = new Uint8Array(size * components); - var tmpCanvas = new ScratchCanvas(width, height); + var tmpCanvas = createScratchCanvas(width, height); var tmpCtx = tmpCanvas.getContext('2d'); tmpCtx.drawImage(img, 0, 0); var data = tmpCtx.getImageData(0, 0, width, height).data; diff --git a/src/pattern.js b/src/pattern.js index dff2a5b..8f5611c 100644 --- a/src/pattern.js +++ b/src/pattern.js @@ -222,7 +222,7 @@ var TilingPattern = (function TilingPatternClosure() { 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 var tmpCtx = tmpCanvas.getContext('2d');