return CanvasExtraState;
})();
-function ScratchCanvas(width, height) {
+function createScratchCanvas(width, height) {
var canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
// 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;
// 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);
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;
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;
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');