Mercurial > dwindows
comparison mac/dw.m @ 2196:f0611d5385f9
Mac: Fix CGContext 0x0 warnings by checking the CGContext is valid first.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 25 Oct 2020 22:20:44 +0000 |
parents | 8c6f087e7182 |
children | 70460d0afd03 |
comparison
equal
deleted
inserted
replaced
2195:8c6f087e7182 | 2196:f0611d5385f9 |
---|---|
989 bgcolor = nil; | 989 bgcolor = nil; |
990 } | 990 } |
991 else | 991 else |
992 { | 992 { |
993 bgcolor = [[NSColor colorWithDeviceRed: DW_RED_VALUE(input)/255.0 green: DW_GREEN_VALUE(input)/255.0 blue: DW_BLUE_VALUE(input)/255.0 alpha: 1] retain]; | 993 bgcolor = [[NSColor colorWithDeviceRed: DW_RED_VALUE(input)/255.0 green: DW_GREEN_VALUE(input)/255.0 blue: DW_BLUE_VALUE(input)/255.0 alpha: 1] retain]; |
994 [bgcolor set]; | 994 #ifdef BUILDING_FOR_YOSEMITE |
995 NSRectFill([self bounds]); | 995 if([[NSGraphicsContext currentContext] CGContext]) |
996 #else | |
997 if([[NSGraphicsContext currentContext] graphicsPort]) | |
998 #endif | |
999 { | |
1000 [bgcolor set]; | |
1001 NSRectFill([self bounds]); | |
1002 } | |
996 } | 1003 } |
997 [self setNeedsDisplay:YES]; | 1004 [self setNeedsDisplay:YES]; |
998 [orig release]; | 1005 [orig release]; |
999 } | 1006 } |
1000 @end | 1007 @end |