From 3f286803d0cad3eacf4f44beed2f13b55995ec90 Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Fri, 30 Dec 2011 16:45:33 -0600 Subject: [PATCH] Move the media left-top corner to the (0,0) canvas position --- src/canvas.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/canvas.js b/src/canvas.js index 00858c937..7221b72cb 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -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 = []; },