Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas changed after renderToCanvas #50

Open
GoogleCodeExporter opened this issue Jul 24, 2015 · 1 comment
Open

Canvas changed after renderToCanvas #50

GoogleCodeExporter opened this issue Jul 24, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant