Re: Strange issue in stroking a bezier path
Re: Strange issue in stroking a bezier path
- Subject: Re: Strange issue in stroking a bezier path
- From: Peter Teeson <email@hidden>
- Date: Sat, 05 May 2012 16:12:53 -0400
First of all thanks Jens for taking the time to reply and educate me.
On 2012-05-05, at 12:40 PM, Jens Alfke wrote:
> On May 5, 2012, at 7:41 AM, Peter Teeson wrote:
>> But I did not realize that the bounds stroke was straddling the view content edges.
>> How did you learn that?
>
> If you think about it, drawing a stroke along a path _has_ to draw on both sides of the path
> (i.e. centered on the path) because there isn’t necessarily any inside or outside;
> the path might not be closed, or it might be a figure 8 or something.
Good points Jens. I never gave a thought to look up -stroke in the NSBezierPath reference.
> Another side effect of this is that, if the path width is an odd number of pixels,
> you should offset your coordinates by 0.5 to make sure you completely fill pixels,
> otherwise you’ll have fuzzy borders on your horizontal and vertical strokes.
>
> —Jens
As to odd number of pixels I was under the impression that the parameters are in points,
which are a unit of length* whereas pixels are related to hardware specs. e.g. Line width is in points.
So it is not the responsibility of the device driver to map points to pixels in a device dependent way?
I wish to write resolution independent code which to me implies I should use points.
Are you saying that I have to compute the path width in pixels? And then adjust for valence? etc?
If so I have been harbouring an illusion that I'm responsible for points and the drivers are responsible
for mapping to the hardware. If I am wrong then doesn't this place an undue burden on the programmers.
Have I got it wrong? But anyway thanks for taking the time.
respect….
Peter
*[Point is a physical unit of length, used in typography.
It's equal to 1/12 Pica, and 1 Pica = 1/6 inch. So 1 pt = 1/72 inch]
_______________________________________________
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