small medium large xlarge

14 Mar 2009, 19:32
Steve Finkelstein (22 posts)

Hi Bill,

This is a rudimentary question regarding your example in Chapter 2 - First Animation. Just looking over the following code in initializeFramePositions:

rightFramePosition = NSMakeRect(7.0f * frameX / 8.0f, 
                              7.0f *frameY / 16.0f, 
                              frameX / 8.0f, frameY/ 8.0f);

I was curious, how did you derive the math to properly position the right frame? Is there a particular geometry algorithm in order to be able to determine how to pin point where you want your NSImageView to end up?

Thanks a bunch!


17 Mar 2009, 13:05
Bill Dudney (917 posts)

Hey Steve,

No major in math required. It was basically trial and error. Just wanted to make the frame 1/8th. :)

You must be logged in to comment