Skip to content

Instantly share code, notes, and snippets.

@visigoth
Created July 9, 2011 20:06
Show Gist options
  • Save visigoth/1073911 to your computer and use it in GitHub Desktop.
Save visigoth/1073911 to your computer and use it in GitHub Desktop.
- (void)updateFrame {
NSRect frame = _docView.frame;
// When in landscape mode, flip around the width/height.
if ([_docView frameRotation] == 90.) {
CGFloat t = frame.size.width;
frame.size.width = frame.size.height;
frame.size.height = t;
}
// Scale the frame.
frame.size.width = frame.size.width * _scale;
frame.size.height = frame.size.height * _scale;
self.frame = frame;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment