From f80fd13fe5c6f893914f173ffa7f140d38de1fe8 Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Thu, 23 Feb 2012 15:46:00 +0100 Subject: [PATCH] new ScratchCanvas -> createScratchCanvas and fix linting --- src/canvas.js | 6 +++--- src/core.js | 6 +++--- src/pattern.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index db1461aa7..7fb85f1b5 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 b62302a9c..16b7ee15d 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 dff2a5b44..8f5611ccd 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');