Re: CGContextShowTextAtPoint upside down
Re: CGContextShowTextAtPoint upside down
- Subject: Re: CGContextShowTextAtPoint upside down
- From: Aki Inoue <email@hidden>
- Date: Sun, 19 Mar 2006 22:37:57 -0800
I believe the view's coordinate is simply flipped.
NSFont automatically compensates when rendering into a flipped
coordinate system ([NSGraphicsContext isFlipped] returning YES).
If you're rendering with CGContextShowTextAtPoint (which we recommend
not to use), you need to compensate by yourself by flipping either the
current graphics state or the text matrix.
Aki
On Mar 17, 2006, at 8:10 PM, Caleb Cannon wrote:
Hello,
I have an app with a custom NSView that fills the entire window
except for a toolbar. I'm drawing several strings with
CGContextShowTextAtPoint(). Sometimes when I click on the search
field in the toolbar and then on the view the strings are all drawn
upside down. The problem is intermittent and goes away when the
window is resized. Has anyone experienced this before or know what
to do about it?
It sounds like the graphics state of your view is in an inconsistent
state when you try to draw in it.
More likely than not, the problem is with the text matrix of the
graphics context. If you have any code that manipulates the text
matrix, you should check it carefully to ensure that you save and
restore the graphics state around those changes.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden