• 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: Stephane Sudre <email@hidden>
  • Date: Mon, 2 May 2005 19:09:35 +0200


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


On May 2, 2005, at 4:10 AM, Thomas Bruhin wrote:

I am working on a graphing application which is nearly finished. The last problem to be solved is the one I now have serious trouble with: I want to be able to draw the labels for my horizontal axis not only horizontally (which works perfect using the drawAtPoint Method of the NSAttributedString class) but vertically (90 degrees rotated) and even in some other degree like 30 or 60 or whatever. I found a (partial) solution in the list-archives: "Unwanted clip of rotated text". I followed the thread Erez Anzel and Douglas Davidson had, and implemented the methods from Apples CircleView demo application. It works fine, however the overhead is quite big, since I have to draw each glyph individually. This was also noted by Douglas and he suggested to do it all in one call to the Glyph drawing method. But this gives me a really hard time :-( I just don't get it!


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.

_______________________________________________
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


  • Follow-Ups:
    • Re: (freely) Rotating Text
      • From: Nicko van Someren <email@hidden>
    • Re: (freely) Rotating Text
      • From: Douglas Davidson <email@hidden>
References: 
 >(freely) Rotating Text (From: Thomas Bruhin <email@hidden>)
 >Re: (freely) Rotating Text (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: (freely) Rotating Text
  • Next by Date: Re: Creating a Cocoa Help Book
  • Previous by thread: Re: (freely) Rotating Text
  • Next by thread: Re: (freely) Rotating Text
  • Index(es):
    • Date
    • Thread