On May 8, 2012, at 3:16 PM, Peter Teeson <ptee...@me.com> wrote:

> This is a continuation of my previous issue stroking a bezier path.

Hi Peter, I'm not sure what issue you were having.
WRT:

> In my sub-class -initWithFrame:frame I do the following:
>    self = [super initWithFrame:frame];
>    if (self) {
>        // Initialization code here.
>        frame.size.width = 200.0;
>        frame.size.height = 200.0;
>        frame.origin.x = 50.0;
>        frame.origin.y = 50.0;
> 
> Should I be pixel aligning it?

Your code above is already point aligned, there for it is pixel aligned. If the 
frame was say 200.2 or 200.5, then you should pixel align it.

> And is this the correct way?
>       frame = [self convertRectToBacking: frame];
>       frame = [self convertRectFromBacking: frame];

The above code doesn't do anything except convert back and forth. Say you have 
a frame origin of 200.5 that you want to be pixel aligned, you would do this:

>       frame = [self convertRectToBacking: frame];

Floor in "pixel space".
frame.origin.x = floor(frame.origin.x);

>       frame = [self convertRectFromBacking: frame];

Now frame is pixel aligned and is back in "point space".

corbin

> 
>       [self setFrame:frame];
>       [self setNeedsDisplay:YES];
>               … ….
> 
> 
> Thanks….
> 
> _______________________________________________
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/corbind%40apple.com
> 
> This email sent to corb...@apple.com


_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to