Re: [CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius]
Re: [CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius]
- Subject: Re: [CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius]
- From: Graham Cox <email@hidden>
- Date: Tue, 02 Dec 2014 09:50:25 +1100
> On 2 Dec 2014, at 6:19 am, Bill Cheeseman <email@hidden> wrote:
>
> Can anyone suggest another approach?
Not another approach, but a possible alternative explanation. Antialiasing. Those curved corners will cause various nearby pixels to be rendered for antialiasing, and these may differ very slightly depending on all sorts of factors - line width, the colours used, the exact alignment of the path to the pixel grid, as well as the underlying curve algorithm. It's very hard to make two overlaid curves always hit exactly the same pixels even when using the same curve algorithm.
Is there no way to avoid having to overlay two curves? Maybe clip the content to a round-cornered rect then finally draw the same path on top? (Not sure if that's actually what you want, it's a little hard to visualise from the verbal description).
--Graham
_______________________________________________
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