Skip to content

Commit c8d7985

Browse files
committed
Fix Save & Restore transformation test
``` ctx.translate(10, 10) ctx.fillRect(0, 0, 10, 10) ctx.save() ctx.restore() ctx.translate(10, 10) ctx.fillRect(0, 0, 10, 10) ```
1 parent c228ba4 commit c8d7985

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

canvas2svg.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,12 +486,13 @@
486486
ctx.prototype.save = function () {
487487
var group = this.__createElement("g");
488488
var parent = this.__closestGroupOrSvg();
489+
var state = this.__getStyleState();
489490
this.__groupStack.push(parent);
490491
parent.appendChild(group);
491-
this.__currentElement = group;
492492
this.__applyTransform(group);
493+
this.__currentElement = group;
493494
this.__currentMatrix = new DOMMatrix();
494-
this.__stack.push(this.__getStyleState());
495+
this.__stack.push(state);
495496
};
496497

497498
/**

0 commit comments

Comments
 (0)