Reputation: 445
I'm working with android canvas and sometimes the logic is like:
the problem is that I didn't find any convinient way to save/restore Paint settings. I'm not sure that doing it manually is a good way. Could you please advise?
Upvotes: 4
Views: 762
Reputation: 10806
You should make as many paint objects as you need to paint draw on the canvas. You don't want to go changing them on the fly, they are only being used in draw which means you need them already having the value they need to paint. You restore and save on the canvas because that's just popping matrix off the stack, but, paints should be pre-established.
Upvotes: 2