Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a couple of CGContext questions



On Jan 31, 2007, at 4:46 AM, David Duncan wrote:

There is one more very important reason that I didn't touch on before about why you wouldn't want to invert the CTM in order to get back to identity -- the context may not have started out with the identity transformation.

HIView sets up your context such that the CTM gives you a coordinate system that looks like Quickdraw. Take the inverse of the CTM and you will get the default coordinate system instead of the Quickdraw one you may be expecting.

Additionally, there is Resolution Independence. This is generally implemented in the frameworks by scaling the CGContext appropriately -- inverting the CTM will defeat this feature. Someday when your users have control over this feature they will run your application and wonder why some of the drawing is tiny :).

I wasn't expecting that one would reset the transform inappropriately. There could be cases where you're nested down several save/transform/restore levels and need to get back to the identity transform do perform an operation before continuing on with the current transform.


Particularly if you own the context, HIView and/or Resolution Independence issues shouldn't be an issue -within- that context, at least in this context. :-)

steve

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: a couple of CGContext questions (From: Mike Kluev <email@hidden>)
 >Re: a couple of CGContext questions (From: David Duncan <email@hidden>)
 >Re: a couple of CGContext questions (From: David Duncan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.