• 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
Panther text shadows flip in NSImage...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Saving State of App menu
      • From: Mike Chambers <email@hidden>
  • Prev by Date: Re: textShouldEndEditing Issues!
  • Next by Date: Saving State of App menu
  • Previous by thread: Re: textShouldEndEditing Issues!
  • Next by thread: Saving State of App menu
  • Index(es):
    • Date
    • Thread