• 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
Re: An NSShadow question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An NSShadow question


  • Subject: Re: An NSShadow question
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 2 Apr 2004 11:42:25 -0800

On Apr 1, 2004, at 10:17 PM, Steve Sims wrote:

Here's the problem. I have a closed bezier in an NSBezierPath object with a wide outline (about 10 units). I set up an NSShadow with a reasonable offset (about 20, 20 units) and apply it using the set method so that when I draw my bezier I'll get a shadow. I then draw my bezier using stroke then fill. The shadow that gets drawn has a darker section of shadow where the stroke and fill overlap. Also the shadow for the fill is rendered on top of the stroked path. This looks bizarre and is not what I want.

Now the Quartz TLayer sample code kind of solves this problem with all shadows being drawn behind all other drawn objects, however it manages this by not using NSShadow, but rather using CG API calls. It does this by using a transparency layer.

I tried to use the same CG API calls that TLayer uses together with NSShadow, but this does not work - the CG calls seem to be ignored. My solution has been to abandon using NSShadow.

-[NSShadow set] is basically a Cocoa wrapper around CGContextSetShadow/CGContextSetShadowWithColor; you should be able to do essentially the same things with either one. If you're seeing a situation where that's not the case, perhaps you could post enough of the details to reproduce it.

Douglas Davidson
_______________________________________________
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:
    • Re: An NSShadow question
      • From: Steve Sims <email@hidden>
References: 
 >An NSShadow question (From: Steve Sims <email@hidden>)

  • Prev by Date: Re: indexed accessors and NSArrayControllers (followup)
  • Next by Date: Re: Java or Objective-C for Cocoa?
  • Previous by thread: Re: An NSShadow question
  • Next by thread: Re: An NSShadow question
  • Index(es):
    • Date
    • Thread