Mailing Lists: Apple Mailing Lists

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

Text drawing using Quartz in an PowerPlant LPane - how to invert y axis?



I'm trying to draw some text in in a custom PowerPlant LPane using Quartz.

I have the text drawing OK, but am having problems because the y axis is
reversed when using Quartz so the location is incorrect.

My text is drawn correctly in the x position, but y seems bizarre. Y is
inverted (which I know from the Quartz docs), but also the offset seems very
strange. Y=0 does not seem to be the bottom of my LPane, or even the LPane's
owner window but rather some location about 80 pixels below the bottom edge
of my LPane.

I read the note in the Apple docs about how to invert the Y axis:

Code that transforms the Quartz origin to be at the upper-left
 CGContextSaveGState (myContext);
CGContextTranslateCTM (myContext, 0, myOrigin.y + myPortHeight);
CGContextScaleCTM (myContext, 1.0f, -1.0f);
// Your drawing code here.
CGContextRestoreGState (myContext);

I'm not sure what values get and use for myOrigin.y and myPortHeight.

Thanks in advance.


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

This email sent to 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.