From 2380b38b27ee0d06958055f4280f1dca84696a14 Mon Sep 17 00:00:00 2001 From: pramodhkp Date: Sat, 5 Jul 2014 14:18:11 +0530 Subject: [PATCH] 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 c253b4641..b5878e175 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;