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: Fri, 18 Apr 2008 23:26:58 +1000
On 18 Apr 2008, at 11:21 pm, Scott Thompson wrote:
Setting a line width of 0 draws a 1-pixel wide line at the
resolution of the device it draws to, so on screen, that's 1/72 of
an inch (approx) on a printer 1/600 inch, say. It's a useful way to
isolate drawing from any CTM scaling. This is handy for drawing a
selection rect outline on top of a zoomed image where you don't
want the selection itself to be scaled up (among many other uses).
So yes, I'd say it works - and Quartz most definitely does draw
strokes with a line width of 0.
No, Quartz 2D does not draw zero width strokes.
If you use NSBezierPath and supply a stroke width of 0 then Cocoa
will fudge the stroke width on your behalf and come up with
something that approximates a single pixel line, but Quartz 2D
itself will not draw a 0 pixel wide line. You can try it
Ah, I stand corrected - I was taking "Quartz" to mean NSBezierPath,
which of course is not strictly correct. My assumption was that the
functionality exhibited by NSBezierPath came up from Quartz, but I see
now that's not the case.
G.
_______________________________________________
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