Search code examples
objective-ccocoansviewappkitnsscrollview

Zooming in an NSView


I have an NSView in which the user can draw circles. These circles are stored as an array of NSBezierPaths, and in drawRect:, I loop through the array and call -stroke on each of the paths. How do I add a button to zoom in and out the NSView? Just change the bounds of the view?

Thanks.


Solution

  • Send your view a scaleUnitSquareToSize: message.