I'm still learning some of the ins and outs of custom view drawing in Cocoa. I have a custom view where I draw lines and points based on the corresponding points in a larger rect elsewhere of a fixed size. I would like to have my drawing scale up or down when the view is resized, but maintain an aspect ratio same as the larger rect.
What is the best way to scale the drawing? Do I need to somehow apply an affine transform? Or should I be drawing to an imageRef? I'm not really sure exactly how to do ether one in this case or how to keep that in sync with the size of the view and the aspect ratio of the larger rect where coordinates come from. Any tips or links to example code are greatly appreciated.