• 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: [CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius]
      • From: Bill Cheeseman <email@hidden>
References: 
 >[CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius] (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: App fails on Yosemite - "Cannot remove an observer"
  • Next by Date: Layer-backed multiline text view rendering dim
  • Previous by thread: [CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius]
  • Next by thread: Re: [CALayer cornerRadius] vs. [NSBezierPath bezierPathWithRoundedRect:xRadius:yRadius]
  • Index(es):
    • Date
    • Thread