Graham Cox wrote:
Offsetting by 0.5 makes it draw such that the exact pixel is filled.

When a bezier path is more complicated it can become very ugly to add 0.5 to all coordinates. To avoid this the NSBezierPath class offers the method - transformUsingAffineTransform: So you can create a bezier path "as usual" and before rendering (stroke etc.) you
apply a tranformation:

NSBezierPath *bezierPath = [NSBezierPath bezierPath];
NSAffineTransform *transform = [NSAffineTransform transform];
// build the bezierPath
[transform translateXBy: 0.5 yBy: 0.5];
[bezierPath transformUsingAffineTransform: transform];
[bezierPath stroke];

And: if the bezier path shall always be drawn 1 pixel wide, independent
--
Heinrich Giesen
[EMAIL PROTECTED]


_______________________________________________

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to