@@ -216,8 +216,8 @@ export class WebglCharAtlas implements IDisposable {
216216 }
217217 }
218218
219- private _getForegroundCss ( bg : number , bgColorMode : number , bgColor : number , fg : number , fgColorMode : number , fgColor : number , inverse : boolean , bold : boolean ) : string {
220- const minimumContrastCss = this . _getMinimumContrastCss ( bg , bgColorMode , bgColor , fg , fgColorMode , fgColor , inverse , bold ) ;
219+ private _getForegroundCss ( bg : number , bgColorMode : number , bgColor : number , fg : number , fgColorMode : number , fgColor : number , inverse : boolean , bold : boolean , isPowerLineGlyph : boolean ) : string {
220+ const minimumContrastCss = this . _getMinimumContrastCss ( bg , bgColorMode , bgColor , fg , fgColorMode , fgColor , inverse , bold , isPowerLineGlyph ) ;
221221 if ( minimumContrastCss ) {
222222 return minimumContrastCss ;
223223 }
@@ -281,8 +281,8 @@ export class WebglCharAtlas implements IDisposable {
281281 }
282282 }
283283
284- private _getMinimumContrastCss ( bg : number , bgColorMode : number , bgColor : number , fg : number , fgColorMode : number , fgColor : number , inverse : boolean , bold : boolean ) : string | undefined {
285- if ( this . _config . minimumContrastRatio === 1 ) {
284+ private _getMinimumContrastCss ( bg : number , bgColorMode : number , bgColor : number , fg : number , fgColorMode : number , fgColor : number , inverse : boolean , bold : boolean , isPowerLineGlyph : boolean ) : string | undefined {
285+ if ( this . _config . minimumContrastRatio === 1 || isPowerLineGlyph ) {
286286 return undefined ;
287287 }
288288
@@ -370,13 +370,6 @@ export class WebglCharAtlas implements IDisposable {
370370 `${ fontStyle } ${ fontWeight } ${ this . _config . fontSize * this . _config . devicePixelRatio } px ${ this . _config . fontFamily } ` ;
371371 this . _tmpCtx . textBaseline = TEXT_BASELINE ;
372372
373- this . _tmpCtx . fillStyle = this . _getForegroundCss ( bg , bgColorMode , bgColor , fg , fgColorMode , fgColor , inverse , bold ) ;
374-
375- // Apply alpha to dim the character
376- if ( dim ) {
377- this . _tmpCtx . globalAlpha = DIM_OPACITY ;
378- }
379-
380373 // Check if the char is a powerline glyph, these will be restricted to a single cell glyph, no
381374 // padding on either side that are allowed for other glyphs since they are designed to be pixel
382375 // perfect but may render with "bad" anti-aliasing
@@ -387,6 +380,12 @@ export class WebglCharAtlas implements IDisposable {
387380 isPowerlineGlyph = true ;
388381 }
389382 }
383+ this . _tmpCtx . fillStyle = this . _getForegroundCss ( bg , bgColorMode , bgColor , fg , fgColorMode , fgColor , inverse , bold , isPowerlineGlyph ) ;
384+
385+ // Apply alpha to dim the character
386+ if ( dim ) {
387+ this . _tmpCtx . globalAlpha = DIM_OPACITY ;
388+ }
390389
391390 // For powerline glyphs left/top padding is excluded (https://github.com/microsoft/vscode/issues/120129)
392391 const padding = isPowerlineGlyph ? 0 : TMP_CANVAS_GLYPH_PADDING ;
0 commit comments