[Pkg-javascript-commits] [pdf.js] 23/246: Fixed setGState, viewport transform

David Prévot taffit at moszumanska.debian.org
Sun Sep 7 15:36:21 UTC 2014


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

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

commit 2380b38b27ee0d06958055f4280f1dca84696a14
Author: pramodhkp <prmdh1 at gmail.com>
Date:   Sat Jul 5 14:18:11 2014 +0530

    Fixed setGState, viewport transform
---
 src/display/svg.js | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/display/svg.js b/src/display/svg.js
index c253b46..b5878e1 100644
--- a/src/display/svg.js
+++ b/src/display/svg.js
@@ -25,8 +25,7 @@ function createScratchSVG(width, height) {
   svg.setAttributeNS(null, 'version', '1.1');
   svg.setAttributeNS(null, 'width', width + 'px');
   svg.setAttributeNS(null, 'height', height + 'px');
-  svg.setAttributeNS(null, 'viewBox', '0 ' + (-height) + ' ' +
-    width + ' ' + height);
+  svg.setAttributeNS(null, 'viewBox', '0 0 ' + width + ' ' + height);
   return svg;
 }
 
@@ -203,8 +202,8 @@ var SVGGraphics = (function SVGGraphicsClosure(ctx) {
       this.viewport = viewport;
       this.transformMatrix = IDENTITY_MATRIX;
       this.pgrp = document.createElementNS(NS, 'svg:g'); // Parent group
-      this.pgrp.setAttributeNS(null, 'transform', 'scale(' + viewport.scale +
-        ',' + -viewport.scale + ')');
+      this.pgrp.setAttributeNS(null, 'transform',
+        'matrix(' + viewport.transform +')');
       this.tgrp = document.createElementNS(NS, 'svg:g'); // Transform group
       this.tgrp.setAttributeNS(null, 'transform',
         'matrix(' + this.transformMatrix +')');
@@ -304,7 +303,7 @@ var SVGGraphics = (function SVGGraphicsClosure(ctx) {
             this.setDash(args[0], args[1]);
             break;
           case OPS.setGState:
-            this.setGState(args);
+            this.setGState(args[0]);
             break;
           case OPS.fill:
             this.fill();
@@ -690,7 +689,7 @@ var SVGGraphics = (function SVGGraphicsClosure(ctx) {
           case 'FL':
             break;
           case 'Font':
-            this.setFont(value[0], value[1]);
+            this.setFont(value);
             break;
           case 'CA':
             break;

-- 
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