Merge pull request #776 from jviereck/jpegimage_cleanup
Don't create JpegImage object anymore - go functional style
This commit is contained in:
commit
cb592d6e51
4 changed files with 14 additions and 34 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue