• 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: (freely) Rotating Text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (freely) Rotating Text


  • Subject: Re: (freely) Rotating Text
  • From: Nicko van Someren <email@hidden>
  • Date: Mon, 2 May 2005 19:25:40 +0100

On 2 May 2005, at 18:09, Stephane Sudre wrote:

On 2 mai 05, at 18:46, Douglas Davidson wrote:

You're making this too complicated.  Just use an NSAffineTransform followed by a drawAtPoint: or drawInRect:.  The only tricky part is making sure you have the right affine transform to place your text where you want it.

Isn't there also a limitation with the bounds of the view?

IIRC what I've seen in the past, depending on the order in which you do the translation and rotation, you might end up with a cut or blank string.

Clearly you need to make sure that the transform of the rectangle you pass to drawInRect: lies within the view you are drawing in, otherwise you may find that things are drawn outside your view (and thus will get clipped). This is the tricky part as mentioned by Douglas. You might find it easier to do the calculations by considering where you wish the middle of the text rectangle to end up and applying any rotations about that centre.


	Nicko

_______________________________________________
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: 
 >(freely) Rotating Text (From: Thomas Bruhin <email@hidden>)
 >Re: (freely) Rotating Text (From: Douglas Davidson <email@hidden>)
 >Re: (freely) Rotating Text (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Re: Cocoa Technologies Back-Story?
  • Next by Date: Re: Cocoa Technologies Back-Story?
  • Previous by thread: Re: (freely) Rotating Text
  • Next by thread: Re: (freely) Rotating Text
  • Index(es):
    • Date
    • Thread