agusibrahim / jscapturecanvas

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

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 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