Merge pull request #776 from jviereck/jpegimage_cleanup

Don't create JpegImage object anymore - go functional style
This commit is contained in:
notmasteryet 2011-12-07 11:11:11 -08:00
commit cb592d6e51
4 changed files with 14 additions and 34 deletions

View file

@ -1037,8 +1037,8 @@ var CanvasGraphics = (function canvasGraphics() {
},
paintJpegXObject: function canvasGraphicsPaintJpegXObject(objId, w, h) {
var image = this.objs.get(objId);
if (!image) {
var domImage = this.objs.get(objId);
if (!domImage) {
error('Dependent image isn\'t ready yet');
}
@ -1048,7 +1048,6 @@ var CanvasGraphics = (function canvasGraphics() {
// scale the image to the unit square
ctx.scale(1 / w, -1 / h);
var domImage = image.getImage();
ctx.drawImage(domImage, 0, 0, domImage.width, domImage.height,
0, -h, w, h);