Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath
Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath
- Subject: Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath
- From: Graham Cox <email@hidden>
- Date: Thu, 17 Apr 2008 09:42:28 +1000
Because strokes are drawn centred on the coordinate of the path, so a
1-pixel line extends 0.5 of a pixel above and below the coordinate.
Offsetting by 0.5 makes it draw such that the exact pixel is filled.
------
S.O.S.
On 17 Apr 2008, at 9:17 am, Martin wrote:
It works!
Why such a behaviour?
Thanks,
-Martin
On Apr 17, 2008, at 1:15 AM, John Terranova wrote:
Try adding these lines before creating the NSBezierPath:
cellFrame.origin.x += 0.5;
cellFrame.origin.y += 0.5;
_______________________________________________
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