Skip to content
Snippets Groups Projects
Commit 58944bf2 authored by George Nachman's avatar George Nachman
Browse files

Fix a bug where thin strokes be used when the setting was "dark background" or...

Fix a bug where thin strokes be used when the setting was "dark background" or "retina + dark background" even when the background was light because the background color didn't get passed through since we dididn't want to split up ligatures on background color changes. Since the thin strokes setting means the foreground depends on the background, the background color must be passed through and ligatures will be broken if the background color changes within them. Issue 6027
parent c2275378
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -387,7 +387,7 @@ typedef struct iTermTextColorContext {
 
// Now iterate over the lines and paint the characters.
CGContextRef ctx = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
if (self.minimumContrast > 0 || self.colorMap.mutingAmount > 0 || self.colorMap.dimmingAmount > 0) {
if ([self textAppearanceDependsOnBackgroundColor]) {
[self drawForegroundForBackgroundRunArrays:backgroundRunArrays
ctx:ctx];
} else {
Loading
Loading
@@ -419,6 +419,25 @@ typedef struct iTermTextColorContext {
}
}
 
- (BOOL)textAppearanceDependsOnBackgroundColor {
if (self.minimumContrast > 0) {
return YES;
}
if (self.colorMap.mutingAmount > 0) {
return YES;
}
if (self.colorMap.dimmingAmount > 0) {
return YES;
}
if (self.thinStrokes == iTermThinStrokesSettingDarkBackgroundsOnly) {
return YES;
}
if (self.thinStrokes == iTermThinStrokesSettingRetinaDarkBackgroundsOnly && _isRetina) {
return YES;
}
return NO;
}
#pragma mark - Drawing: Background
 
- (void)drawBackgroundForLine:(int)line
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment