Panther text shadows flip in NSImage...
Panther text shadows flip in NSImage...
- Subject: Panther text shadows flip in NSImage...
- From: Steve Mykytyn <email@hidden>
- Date: Fri, 12 Dec 2003 15:42:56 -0800
Under some conditions, text shadowing can flip its starting position
vertically ...
I use an NSTextView to let users control the appearance of various
labeled text styles - everything works fine here. A shadow angle of
315 degrees has the shadow appearing to the lower right...
To optimize the display of the main view, some drawing is done into an
NSImage. First, the coordinate system is flipped to get the text
drawing right side up, then the
// flip coordinates for text
flipY = [[NSAffineTransform alloc]init];
[flipY scaleXBy:1.0 yBy:-1.0];
[NSGraphicsContext saveGraphicsState];
[flipY concat];
// retrieve the attributes
NSDictionary *attrs = [[self sampleText] attributesAtIndex:0
effectiveRange:nil];
// draw the label
[label drawAtPoint:localPoint withAttributes:attrs];
Unfortunately, this results in the text shadow appearing to the upper
right as if the angle was 45 degrees, not 315, when drawing into an
NSImage.
Does anyone have a work-around for this other than twiddling the
attributes directly, or have I just missed a Panther trick?
_______________________________________________
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.