• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CGContextShowTextAtPoint upside down
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >CGContextShowTextAtPoint upside down (From: Caleb Cannon <email@hidden>)
 >Re: CGContextShowTextAtPoint upside down (From: Scott Thompson <email@hidden>)

  • Prev by Date: Re: NSString propertyList crash
  • Next by Date: NSTreeController w/Core Data: chaining NSManagedObjects in a hierarchy
  • Previous by thread: Re: CGContextShowTextAtPoint upside down
  • Next by thread: Preferences for Applications
  • Index(es):
    • Date
    • Thread