Re: NSBezierPath linewidth not correct
Re: NSBezierPath linewidth not correct
- Subject: Re: NSBezierPath linewidth not correct
- From: Gustavo Pizano <email@hidden>
- Date: Sun, 3 Jan 2010 18:19:59 +0100
AHA Interesting.. I was thinking something like that.. but in lower level using Quartz directly adn the CGContextRef and the transformations.
I will give it a try ...
Thanks :D
Gustavo
On Jan 3, 2010, at 12:29 PM, Heinrich Giesen wrote:
>
> On 03.01.2010, at 00:45, Rob Keniger wrote:
>
>>
>> It will probably be easier to create an NSAffineTransform and translate the whole context by 0.5px, so all drawing is offset without you needing to fiddle with individual values.
>
> Just a hint:
> NSBezierPath has a method which allows to use NSAffineTransform for this even outside a rendering/drawing process:
>
> Description of transformUsingAffineTransform, a method of NSBezierPath:
>> Transforms all points in the receiver using the specified transform.
>>
>> - (void)transformUsingAffineTransform:(NSAffineTransform *)aTransform
>>
> Example:
>
> NSBezierPath *bPath = // create a path
> // construct the complete path
> NSAffineTransform *transform = [NSAffineTransform transform];
> // move all coordinates to the center of the pixels
> [transform translateXBy: 0.5 yBy: 0.5 ];
> [bPath transformUsingAffineTransform:transform];
> // bPath is now ready for drawing
>
>
> --
> Heinrich Giesen
> email@hidden
>
>
_______________________________________________
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