Re: NSBezierPath stroke width on retina/nonretina
Re: NSBezierPath stroke width on retina/nonretina
- Subject: Re: NSBezierPath stroke width on retina/nonretina
- From: Tamas Nagy <email@hidden>
- Date: Fri, 26 Apr 2013 18:03:25 +0200
Thanks for the tip! I was using integral coordinates without fractions, adding
_newframe = NSInsetRect(_newframe, 0.5f, 0.5f);
fixed the issue!
Thanks!
Tamas
On Apr 26, 2013, at 5:28 PM, Fritz Anderson <email@hidden> wrote:
> 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