• 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: NSBezierPath stroke width on retina/nonretina
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBezierPath stroke width on retina/nonretina


  • Subject: Re: NSBezierPath stroke width on retina/nonretina
  • From: Fritz Anderson <email@hidden>
  • Date: Fri, 26 Apr 2013 10:28:54 -0500

On 26 Apr 2013, at 9:51 AM, Tamas Nagy <email@hidden> wrote:

> Hi,
>
> found a really weird issue with some very basic drawing, and have no idea whats going wrong (or what I missed:)). Basically I've a subclass of NSButton and NSButtonCell with some basic custom drawing. I do a 1px width stroke after all around the button, which is looks cool on my computer having retina display, but it looks really fat on a normal display (please check out the attach picture).
> That is how do the stroke:
>
>    [[NSColor blackColor] setStroke];
>    [_bezelPath setLineWidth:1.0f];
>    [_bezelPath stroke];
>
> Any idea is very welcomed,


You don't say, but are the lines in your Bézier path drawn on integral coordinates (e.g., 10, 10, with no fractions)? The Quartz coordinate system puts points _between_ pixels.

A line going down a series of integral pixels (10.0, 10.0) will be drawn as 50% gray on either side. It looks wide and dim. If you offset them by 0.5 (10.5, 10.5), the line will go straight down the pixels, and be shown thin and black.

	— F

--
Fritz Anderson
Xcode 4 Unleashed: 4.5 supplement for free!
http://www.informit.com/store/xcode-4-unleashed-9780672333279


_______________________________________________

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: NSBezierPath stroke width on retina/nonretina
      • From: Tamas Nagy <email@hidden>
References: 
 >NSBezierPath stroke width on retina/nonretina (From: Tamas Nagy <email@hidden>)

  • Prev by Date: NSBezierPath stroke width on retina/nonretina
  • Next by Date: Re: NSBezierPath stroke width on retina/nonretina
  • Previous by thread: NSBezierPath stroke width on retina/nonretina
  • Next by thread: Re: NSBezierPath stroke width on retina/nonretina
  • Index(es):
    • Date
    • Thread