Skip to content

Commit ad326a3

Browse files
committed
potential fix for silly colorspace crash on default theme?
"It works on my machine"
1 parent 17d5b73 commit ad326a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SCXcodeMinimap/SCSelectionView.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ - (id)initWithFrame:(NSRect)frame
1818
NSObject *DVTFontAndColorTheme = [NSClassFromString(@"DVTFontAndColorTheme") performSelector:@selector(currentTheme)];
1919
NSColor *backgroundColor = [DVTFontAndColorTheme performSelector:@selector(sourceTextBackgroundColor)];
2020

21+
//for some reason we have to do this dance to avoid a crash with the default theme??
22+
NSColor *bacon = [backgroundColor colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]];
23+
2124
// sets the selectionColor to the inverse of the brightnessComponent of the currently selected theme's backgroundColor
22-
[self setSelectionColor:[NSColor colorWithCalibratedHue:0.0f saturation:0.0f brightness:(1.0f - [backgroundColor brightnessComponent]) alpha:0.25f]];
25+
[self setSelectionColor:[NSColor colorWithCalibratedHue:0.0f saturation:0.0f brightness:(1.0f - [bacon brightnessComponent]) alpha:0.25f]];
2326

2427
}
2528
return self;

0 commit comments

Comments
 (0)