Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions framework/Source/CPTLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -330,23 +330,29 @@ -(void)display

if ( [NSView instancesRespondToSelector:@selector(effectiveAppearance)] ) {
CPTGraphHostingView *hostingView = [self findHostingView];
if ( [NSAppearance instancesRespondToSelector:@selector(performAsCurrentDrawingAppearance:)] ) {
NSAppearance *appearance = hostingView.effectiveAppearance;

if ( appearance && [NSAppearance instancesRespondToSelector:@selector(performAsCurrentDrawingAppearance:)] ) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
[hostingView.effectiveAppearance performAsCurrentDrawingAppearance: ^{
[appearance performAsCurrentDrawingAppearance: ^{
[super display];
}];
#pragma clang diagnostic pop
}
else {
else if ( appearance ) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSAppearance *oldAppearance = NSAppearance.currentAppearance;
NSAppearance.currentAppearance = hostingView.effectiveAppearance;
NSAppearance.currentAppearance = appearance;
[super display];
NSAppearance.currentAppearance = oldAppearance;
#pragma clang diagnostic pop
}
else {
// No hosting view; fall back to the default rendering path so the layer still draws.
[super display];
}
}
else {
[super display];
Expand Down