- fixed invalid context warnings with Cocoa backend

A bunch of 'CGContext<...>: invalid context 0x0' messages were printed to console during OpenGL view creation and resizing
This commit is contained in:
alexey.lysiuk 2020-02-01 17:11:56 +02:00
parent 55cfecbe2c
commit 0c2faae48b

View file

@ -186,8 +186,15 @@ namespace
- (void)drawRect:(NSRect)dirtyRect - (void)drawRect:(NSRect)dirtyRect
{ {
[NSColor.blackColor setFill]; if ([NSGraphicsContext currentContext])
NSRectFill(dirtyRect); {
[NSColor.blackColor setFill];
NSRectFill(dirtyRect);
}
else if (self.layer != nil)
{
self.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
}
} }
- (void)resetCursorRects - (void)resetCursorRects