Re: (freely) Rotating Text
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