]> git.parisson.com Git - pdf.js.git/commitdiff
Move the media left-top corner to the (0,0) canvas position
authornotmasteryet <async.processingjs@yahoo.com>
Fri, 30 Dec 2011 22:45:33 +0000 (16:45 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Fri, 30 Dec 2011 22:45:33 +0000 (16:45 -0600)
src/canvas.js

index 00858c93712f59c915c4e33b0b30a5e1272a788d..7221b72cbba47ab64a7ab17fc67b0f09e82653a5 100644 (file)
@@ -255,6 +255,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
       }
       // Scale so that canvas units are the same as PDF user space units
       this.ctx.scale(cw / mediaBox.width, ch / mediaBox.height);
+      // Move the media left-top corner to the (0,0) canvas position
+      this.ctx.translate(-mediaBox.x, -mediaBox.y);
       this.textDivs = [];
       this.textLayerQueue = [];
     },