reduardo7 / androidsvg

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

Canvas changed after renderToCanvas #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The problem. 
If I have a Canvas canv and a Paint paint which I use to draw some text and svg 
images then the following calls don't produce the same

svg.renderToCanvas(canv,frame);
canv.drawText(""+initiative,shift,textHeight,paint);

or 

canv.drawText(""+initiative,shift,textHeight,paint);
svg.renderToCanvas(canv,frame);

I'm not completely sure this is a bug but it took me some time to understand 
this. I'm using androidsvg-1.2.1. 

Now that I understood this I'm working with the workaround

canv.save();
svg.renderToCanvas(canv,frame);
canv.restore();
canv.drawText(""+initiative,shift,textHeight,paint);

Original issue reported on code.google.com by yannick....@math.uzh.ch on 14 Jan 2015 at 4:43

GoogleCodeExporter commented 9 years ago
Yes, that seems like a bug.  The library should not be returning with the 
canvas state changed.

Thanks for the report.

Original comment by paul.leb...@gmail.com on 14 Jan 2015 at 4:50