On 06/12/2012, at 5:59 AM, Peter Teeson <ptee...@me.com> wrote: > In my case I use a number of gradients as well a bezier paths and the crucial > thing was to understand just where and when to save/restore the context.
Well, knowing this is usually a case of common sense. In the vast majority of drawing, you do not need to do this at all, so perhaps you're just doing it "just in case" without fully understanding whether it's really needed. If you overdo it, there is a much bigger likelihood of overdoing it wrong. 1. context save/restores must balance. (if you throw an exception in between, you need to ensure that the restore happens in @finally) 2. you only need to save the context if you make a state change to it that you will want to reverse BEFORE you complete your drawing. 3. Given 2, there are many drawing scenarios where you do not need to save/restore the context at all. 4. I'm pretty sure this is all very well documented in the drawing guide. --Graham _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com