(OSX) Snow Leopard backwards compatibility - NSScreen implementation -

bounds function - first convert NSRect to CGRect, then use CGRectGet*
functions on them
This commit is contained in:
twinaphex 2013-11-09 00:10:00 +01:00
parent fad421e381
commit c49e9b51af

View File

@ -47,7 +47,12 @@
@interface NSScreen (IOSCompat) @end
@implementation NSScreen (IOSCompat)
- (CGRect)bounds { return CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame)); }
- (CGRect)bounds
{
CGRect rect_width = NSRectToCGRect(self.frame);
CGRect rect_height = NSRectToCGRect(self.frame);
return CGRectMake(0, 0, CGRectGetWidth(rect_width), CGRectGetHeight(rect_height));
}
- (float) scale { return 1.0f; }
@end