Re: Transforming NSBezierPaths using NSView
Re: Transforming NSBezierPaths using NSView
- Subject: Re: Transforming NSBezierPaths using NSView
- From: Erik Buck <email@hidden>
- Date: Thu, 22 Feb 2007 09:01:57 -0800 (PST)
Every NSView has a built-in affine transformation matrix. Any valid transform can be applied to drawing in the view. (scale, rotate, skew, translate in any combination)
Rather than transforming all of the paths, just transform the view's coordinate system.
If zooming is all you want, just change the bound size relative to the frame size and all drawing in the view will be scaled.
More specifically, each time the view is re-sized, store the current bounds. After the view's frame has been changed, restore the original bounds. As the frame gets bigger, all drawing will get bigger. As the frame gets smaller, all drawing will get smaller.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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