Re: scaleUnitSquareToSize
Re: scaleUnitSquareToSize
- Subject: Re: scaleUnitSquareToSize
- From: Kyle Sluder <email@hidden>
- Date: Sat, 16 Oct 2010 14:17:38 -0700
On Sat, Oct 16, 2010 at 2:09 PM, <email@hidden> wrote:
> I am using scaleUnitSquareToSize to zoom out / zoom in on a design being
> created in a subclass of NSView.
>
> After calling:
>
> - (IBAction)zoom:(id)sender {
>
> NSSize sz = NSSizeFromString(@"{0.75,0.75}");
> [self scaleUnitSquareToSize:sz];
> [self display];
> }
>
>
> .. the view scales and moves toward the view origin. This is expected
> behavior.
>
> I am looking for a recommendation on how to keep the 'zoomed' contents in
> the center of the view.
>
> Should I do a CGContextTranslateCTM before calling -display? Is this the
> proper approcah?
No, you'd probably want to scale and then translate your bounds origin.
--Kyle Sluder
_______________________________________________
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