TheTedAdams / jscapturecanvas

Automatically exported from code.google.com/p/jscapturecanvas
1 stars 0 forks source link

Repeated ctx.save();ctx.restore() optimization #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Generate some SVG
2. Show the generated code ( part )

...
ctx.transform(0.40,0.00,0.00,0.40,284.71,53.57);
ctx.restore();
ctx.save();
ctx.restore();
ctx.save();
ctx.restore();
ctx.save();
ctx.restore();
ctx.save();
ctx.restore();
ctx.save();
ctx.restore();
ctx.save();
ctx.restore();
ctx.save();
this.gradients [1] = 
    ctx.createRadialGradient(1352.84,-1234.87,0.00,1352.84,-1234.87,184.97);

What is the expected output? What do you see instead?

ctx.transform(0.40,0.00,0.00,0.40,284.71,53.57);
ctx.restore();
ctx.save();
this.gradients [1] = 
    ctx.createRadialGradient(1352.84,-1234.87,0.00,1352.84,-1234.87,184.97);

Original issue reported on code.google.com by xperime...@gmail.com on 2 May 2013 at 9:42