[Pkg-javascript-commits] [pdf.js] 142/210: Update text layer correctly when zooming with USE_ONLY_CSS_ZOOM

David Prévot taffit at moszumanska.debian.org
Thu Jun 5 14:21:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch upstream
in repository pdf.js.

commit 97782cafa42c50bca24e6bcd2ebbe26d16542019
Author: Yury Delendik <ydelendik at mozilla.com>
Date:   Wed May 14 09:47:58 2014 -0500

    Update text layer correctly when zooming with USE_ONLY_CSS_ZOOM
---
 web/page_view.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/web/page_view.js b/web/page_view.js
index 27f01b6..4ec9efd 100644
--- a/web/page_view.js
+++ b/web/page_view.js
@@ -158,12 +158,13 @@ var PageView = function pageView(container, id, scale,
       // the text layer are rotated.
       // TODO: This could probably be simplified by drawing the text layer in
       // one orientation then rotating overall.
+      var textLayerViewport = this.textLayer.viewport;
       var textRelativeRotation = this.viewport.rotation -
-                                 this.textLayer.viewport.rotation;
+                                 textLayerViewport.rotation;
       var textAbsRotation = Math.abs(textRelativeRotation);
-      var scale = (width / canvas.width);
+      var scale = width / textLayerViewport.width;
       if (textAbsRotation === 90 || textAbsRotation === 270) {
-        scale = width / canvas.height;
+        scale = width / textLayerViewport.height;
       }
       var textLayerDiv = this.textLayer.textLayerDiv;
       var transX, transY;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list