-(void)setFrame:(CGRect)frameIn {
if (!ignoreAspectRatio) {
float aspectRatio = self.frame.size.width / self.frame.size.height;
frameIn.size.width = MIN(frameIn.size.width, frameIn.size.height * aspectRatio);
frameIn.size.height = frameIn.size.width/aspectRatio;
}
[super setFrame:frameIn];
}
This kind of programming is not my strong suit, but with a few minutes goofing around in Excel, it was easy to figure out. And it works.
No comments:
Post a Comment