Re: CALayer shadows and CGContext clip rect

2023-01-11 Thread David Young via Cocoa-dev
On Tue, Jan 03, 2023 at 10:03:30AM -0800, David Duncan wrote: > While you may have solved your problem, your general approach is not one that > would be recommended – CALayers are not meant to be drawn into a context, but > rather added to a layer tree to be rendered by the system. For what you a

Re: CALayer shadows and CGContext clip rect

2023-01-03 Thread David Duncan via Cocoa-dev
While you may have solved your problem, your general approach is not one that would be recommended – CALayers are not meant to be drawn into a context, but rather added to a layer tree to be rendered by the system. For what you are doing you would likely have less issue and better performance dr

Re: CALayer shadows and CGContext clip rect

2023-01-01 Thread David Young via Cocoa-dev
On Thu, Dec 15, 2022 at 08:59:24PM -0600, David Young via Cocoa-dev wrote: > Is it possible that a CGContext clip path will clip a shadow cast inside > the clip path, if the CALayer whose content cast the shadow is fully > outside of the clip path? Any ideas why? Just in case it helps somebody in

CALayer shadows and CGContext clip rect

2022-12-15 Thread David Young via Cocoa-dev
My program overrides NSTextView.drawBackground(in:) to draw nested capsules around text in an NSTextView. You can see what I'm talking about in this video: https://twitter.com/defenestrately/status/1593322315709923335 Each capsule has a CALayer with non-zero shadowRadius and shadowOpacity. That