NSShadow with [bezierPath addClip]
NSShadow with [bezierPath addClip]
- Subject: NSShadow with [bezierPath addClip]
- From: Leonardo <email@hidden>
- Date: Tue, 31 Dec 2013 13:15:30 +0100
- Thread-topic: NSShadow with [bezierPath addClip]
In my NSView subclass, I have to draw an image within a bezierPath and apply
an NSShadow to the result.
So within the drawRect: method I add
[bezierPath addClip];
[mImage drawInRect:inRect fromRect:fromRect
operation:NSCompositeSourceOver fraction:mOpacity];
It works. The image gets clipped by the path.
Now I would like to apply the NSShadow to the result, so before those lines
above I add
[bezierPath addClip];
[mShadow set];
[mImage drawInRect:inRect fromRect:fromRect operation:NSCompositeSourceOver
fraction:mOpacity];
I can't get the shadow drawn because the bezierPath is clipping the drawing
area where the shadow should fall.
How to solve this trouble?
I have tried to use a layer, but I get weird results when I resize, rotate
and modify other parameters of the view.
Regards
-- Leonardo
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden