I am having a tremendous problem getting the vertical text in the y
Axis of a graph. If i try to rotate text specified as
NSAttributedString it appears to get translated in nonlinear ways: I
would assume that in the below, the text would
rotate around NSMinX(rect) and NSMinY(rect) but it doesn't.
Consider:
- (void)drawYLabel:(NSRect)rect
{
NSPoint labelHere;
int xOffSet;
if(drawYLabelFlag == YES)
{
NSAffineTransform *transform = [NSAffineTransform
transform];
NSGraphicsContext *context = [NSGraphicsContext
currentContext];
// [transform translateXBy:NSMinY(gRect) yBy:0.0];
[transform rotateByDegrees:90.0];
[context saveGraphicsState];
[transform concat];
xOffSet =NSMinY(rect) + ((gHeight/2.0) - [ylabel
size].width/2.0);
labelHere = NSMakePoint( xOffSet, NSMinY(rect) +[ylabel
size].height) ;
[ylabel drawAtPoint:labelHere];
[context restoreGraphicsState];
}
}
yLabel is a NSAttributed String
gHeight is the height of rect.
rect is a bounding rect for the graph that is smaller than the frame
of the NSView.
yLabel doesn't appear in the NSView
What am I doing wrong here
I remain,
Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Boston: 444 Richards Hall (617) 373-4044
Cellular (617) 755-7523, FAX: (781) 581-6076
eMail: [EMAIL PROTECTED]
http://www.neurotechnology.neu.edu/
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]