From 834f466c05b835c44a5fc2d3db33161040586539 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 19 Jun 2014 23:18:04 -0500 Subject: [PATCH] Fixes SVG transforms on restore --- src/display/svg.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/display/svg.js b/src/display/svg.js index cf82dffc7..225bd11f9 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -132,6 +132,12 @@ var SVGGraphics = (function SVGGraphicsClosure(ctx) { restore: function SVGGraphics_restore() { this.transformMatrix = this.transformStack.pop(); this.current = this.extraStack.pop(); + + this.tgrp = document.createElementNS(NS, 'svg:g'); + this.tgrp.setAttributeNS(null, 'id', 'transform'); + this.tgrp.setAttributeNS(null, 'transform', + 'matrix(' + this.transformMatrix + ')'); + this.pgrp.appendChild(this.tgrp); }, group: function SVGGraphics_group(items) { @@ -669,7 +675,6 @@ var SVGGraphics = (function SVGGraphicsClosure(ctx) { }, rectangle: function SVGGraphics_rectangle(x, y, width, height) { - this.save(); var current = this.current; if (width < 0) { x = x + width;