Re: One pixel width. One.

2008-04-25 Thread Graham Cox
Setting a line width of 0 on NSBezierPath means "draw it 1 pixel wide at whatever resolution the destination device is". 1 pixel on the screen aligned to an integer coordinate will draw two pixels wide at half the brightness (anti-aliasing). Thus, 1. offset your coordinates by 0.5 to avoid

Re: One pixel width. One.

2008-04-25 Thread Lorenzo
CTED]> > Date: Fri, 25 Apr 2008 17:31:17 +0800 > To: cocoa-dev@lists.apple.com, Lorenzo <[EMAIL PROTECTED]> > Subject: Re: One pixel width. One. > > On 4/25/08, Lorenzo <[EMAIL PROTECTED]> wrote: >> I am trying to draw a line with 1 pixel width. No matter wheth

Re: One pixel width. One.

2008-04-25 Thread Joe Goh
On 4/25/08, Lorenzo <[EMAIL PROTECTED]> wrote: > I am trying to draw a line with 1 pixel width. No matter whether the view is > scaled or scrolled, I want to see a 1 pixel thick line. I highly, highly recommend reading this article: http://wincent.com/a/about/wincent/weblog/archives/2007/01/offb

Re: One pixel width. One.

2008-04-25 Thread Graham Cox
Try offsetting the final result by 0.5, so that you draw the actual pixel, not anti-alias across two. G. On 25 Apr 2008, at 5:19 pm, Lorenzo wrote: I am trying to draw a line with 1 pixel width. No matter whether the view is scaled or scrolled, I want to see a 1 pixel thick line. I scale th