Skip to content

Instantly share code, notes, and snippets.

@gregschoen
Last active December 17, 2015 08:09
Show Gist options
  • Save gregschoen/5577939 to your computer and use it in GitHub Desktop.
Save gregschoen/5577939 to your computer and use it in GitHub Desktop.
Blog Gists
- (void) updateFrameSize
{
CGPoint orgPoint = self.frame.origin;
CGSize orgSize = self.frame.size;
scaleX = orgSize.width/sizeOfBounds.width;
scaleY = orgSize.height/sizeOfBounds.height;
self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, sizeOfBounds.width, sizeOfBounds.height);
self.transform = CGAffineTransformScale(self.transform, scaleX, scaleY);
self.frame = CGRectMake(orgPoint.x, orgPoint.y, orgSize.width, orgSize.height);
[self setNeedsDisplay];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment