From c33b92036f8e81102e61f76bc8e378ffdae85ce9 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 12 Feb 2013 16:00:19 +0530 Subject: [PATCH] fix image width/height for zoomed viewport image width/height is off while pdf is zoomed, use raw transform values to compute width/height to fix this. --- src/canvas.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index 794a2f473..6168372d2 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -1286,15 +1286,13 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { 0, -h, w, h); if (this.imageLayer) { var currentTransform = ctx.mozCurrentTransformInverse; - var widthScale = Math.max(Math.abs(currentTransform[0]), 1); - var heightScale = Math.max(Math.abs(currentTransform[3]), 1); var position = this.getCanvasPosition(0, 0); this.imageLayer.appendImage({ objId: objId, left: position[0], top: position[1], - width: w / widthScale, - height: h / heightScale + width: w / currentTransform[0], + height: h / currentTransform[3] }); } this.restore(); @@ -1402,8 +1400,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { imgData: imgData, left: position[0], top: position[1], - width: width / widthScale, - height: height / heightScale + width: width / currentTransform[0], + height: height / currentTransform[3] }); } this.restore();