Re: Avoid drawing in half pixel

2010-05-06 Thread Bill Hernandez
On May 6, 2010, at 9:00 AM, Bill Hernandez wrote: > // > +-+-+-+-+-+-+-+-+ > // DEFINE AND INITIALIZE MAIN RECT VARIABLES > // > +-+-+-+-+-+-+-+-+ > NSUInteger i = 0;

Re: Avoid drawing in half pixel

2010-05-06 Thread Bill Hernandez
Gustavo, I ran into this a few days ago when I was drawing a variable number of rectangles to a view, and found that the spacing was not always exact as one would expect. In my case the gist of it was that <[each unit]> in essence was a <[spacer + rectangleWidth]> someViewWidthRequired = <[sp

Re: Avoid drawing in half pixel

2010-05-06 Thread Alastair Houghton
On 5 May 2010, at 17:01, Simone Tellini wrote: > you can turn it on/off according to your needs: ie. turn it off, draw > vertical/horizontal lines that you don't want to become blurry, turn it on > and draw the rest. I wouldn't be inclined to do that, actually. Much easier in the long run to use

Re: Avoid drawing in half pixel

2010-05-05 Thread Corbin Dunn
On May 5, 2010, at 8:18 AM, Gustavo Pizano wrote: > Hello all. > > I have a split view and inside I have custom views, in one subview Im drawing > lines with a NSBezierPath, and when I move the divider I see sometimes the > lines very thin some others no, so I know this last behavior its bec

Re: Avoid drawing in half pixel

2010-05-05 Thread Gustavo Pizano
On May 5, 2010, at 6:01 PM, Simone Tellini wrote: > On Wed, 5 May 2010 17:52:53 +0200, Gustavo Pizano > wrote: > >> So at the beginning of my drawRect, shall I use NSIntegralRect([self >> bounds])? > > yes, and use the resulting rect's origin as reference point for your > drawing. > >> Im gon

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
On Wed, 5 May 2010 17:52:53 +0200, Gustavo Pizano wrote: > So at the beginning of my drawRect, shall I use NSIntegralRect([self > bounds])? yes, and use the resulting rect's origin as reference point for your drawing. > Im gonna give a try... most probably I need antialiasing, because Im > dr

Re: Avoid drawing in half pixel

2010-05-05 Thread Gustavo Pizano
from apps docs "During layout, make sure views and images are positioned on integral pixel boundaries." this is what Im doing wrong I think... the problem is how to correct it, because when I resize the splitview of course its not staying in a integral pixel.. thats when I see the lines bigger

Re: Avoid drawing in half pixel

2010-05-05 Thread Gustavo Pizano
Hello Simone. So at the beginning of my drawRect, shall I use NSIntegralRect([self bounds])? Im gonna give a try... most probably I need antialiasing, because Im drawing some strings also in the view, so having no AA will affect them isn't it? G. On May 5, 2010, at 5:46 PM, Simone Tellini wr

Re: Avoid drawing in half pixel

2010-05-05 Thread Rob Ross
Try turning off anti-aliasing. Also see : http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html#//apple_ref/doc/uid/TP40003290-CH204-BCICIJAJ Rob On May 5, 2010, at 8:18 AM, Gustavo Pizano wrote: > Hello all. > > I have a split view

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
On Wed, 05 May 2010 17:40:24 +0200, Simone Tellini wrote: > ___ > ok, this weird. If I reply with Thunderbird, the body of the message gets eaten by the mailing list server. I was saying: > I was reading the apple docs about this topic, and I tried a

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com

Re: Avoid drawing in half pixel

2010-05-05 Thread Gustavo Pizano
? On May 5, 2010, at 5:31 PM, Simone Tellini wrote: > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com

Avoid drawing in half pixel

2010-05-05 Thread Gustavo Pizano
Hello all. I have a split view and inside I have custom views, in one subview Im drawing lines with a NSBezierPath, and when I move the divider I see sometimes the lines very thin some others no, so I know this last behavior its because Im drawing in half a pixel. I was reading the apple doc