Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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 14 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.