Re: drawInRect to start from top
Re: drawInRect to start from top
- Subject: Re: drawInRect to start from top
- From: Christian Mittendorf <email@hidden>
- Date: Thu, 8 Jan 2004 14:59:31 +0100
On 08.01.2004, at 14:28, Ivan Myrvold wrote:
I want my custom view to use the NSString drawInRect method to draw
some text in a rectangle. The custom view is drawing the text from the
bottom of the rectangle towards the top, but I want it to start from
the top, and draw the text towards the botto, so that if I have a
single line, it will be on the top of the rectangle, rather as it is
now on the bottom. How do I implement that? The documentation says
something about flipping the view, but that will affect all the other
draw routines then?
Yes, it will affect all other drawing routines in your custom view.
NSViews documentation says:
- (BOOL)isFlipped
Returns YES if the receiver uses flipped drawing coordinates or NO if
it uses native coordinates. NSViews implementation returns NO;
subclasses that use flipped coordinates should override this method to
return YES.
The other solution would be to convert the coordinates for your text
"by hand" in your draw method.
mvh
Christian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.