Re: Quartz 2d drawing problems
Re: Quartz 2d drawing problems
- Subject: Re: Quartz 2d drawing problems
- From: Mike Beam <email@hidden>
- Date: Fri, 03 May 2002 09:58:01 -0500
When you specify the coordinates for drawing your lines you're probably
making them whole integers, right? On an LCD for example, where the idea of
a grid on the screen is obvious, an integer coordinate means the line is
being drawn on the boundry between two pixels. Thus, a one pixel wide line
would extend in width from the center of one pixel to the center of the next
pixel. When Quartz draws the line, it colors any pixel the line touches,
this means both pixels are colored. The solution is to offset all of your
coordinates by 0.5, so the middle of the line is drawn in the middle of a
pixel, and the width of the line extends only to the boundaries of that same
pixel. Doing this means that only one pixel touches the line, and only one
pixel is colored by quartz. Hope this helps!
Mike Beam
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.