From edfacbb5c6ec6501e9ff4a8716040571f9bdf94e Mon Sep 17 00:00:00 2001 From: tisilent Date: Thu, 24 Aug 2023 11:54:18 +0800 Subject: [PATCH] Adjusting the execution process --- .../renderer/shared/CellColorResolver.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/browser/renderer/shared/CellColorResolver.ts b/src/browser/renderer/shared/CellColorResolver.ts index b2d66042..76f482d2 100644 --- a/src/browser/renderer/shared/CellColorResolver.ts +++ b/src/browser/renderer/shared/CellColorResolver.ts @@ -66,15 +66,6 @@ export class CellColorResolver { if (code === NULL_CELL_CODE && cell.extended.underlineStyle !== UnderlineStyle.DOTTED) { $variantOffset = 0; } - const fontSize = this._terminal.options.fontSize; - const drp = this._coreBrowserService.dpr; - const lineWidth = Math.max(1, Math.floor(fontSize! * drp / 15)); - let chWidth: number; - if (typeof code === 'number') { - chWidth = this._unicodeService.wcwidth(code); - } else { - chWidth = this._unicodeService.getStringCellWidth(code); - } // Apply decorations on the bottom layer this._decorationService.forEachDecorationAtCell(x, y, 'bottom', d => { @@ -157,12 +148,22 @@ export class CellColorResolver { this.result.bg = $hasBg ? $bg : this.result.bg; this.result.fg = $hasFg ? $fg : this.result.fg; + // Reset overrides variantOffset this.result.ext &= ~ExtFlags.VARIANT_OFFSET; this.result.ext |= ($variantOffset << 29) & ExtFlags.VARIANT_OFFSET; - // compute next varinatOffset + // Compute next varinatOffset if (cell.extended.underlineStyle === UnderlineStyle.DOTTED) { if (code !== NULL_CELL_CODE) { + const fontSize = this._terminal.options.fontSize; + const drp = this._coreBrowserService.dpr; + const lineWidth = Math.max(1, Math.floor(fontSize! * drp / 15)); + let chWidth: number; + if (typeof code === 'number') { + chWidth = this._unicodeService.wcwidth(code); + } else { + chWidth = this._unicodeService.getStringCellWidth(code); + } $variantOffset = computeVarinatOffset(deviceCellWidth * chWidth, lineWidth, $variantOffset); } } else {