Skip to content

Instantly share code, notes, and snippets.

View visigoth's full-sized avatar

Shaheen Gandhi visigoth

View GitHub Profile
@interface HostView : NSView {
NSView *_docView;
CGFloat _scale;
}
@property (assign) CGFloat scale;
@end
- (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;
}