Reduce duplicate with getDecorationsAtCell method

This commit is contained in:
Daniel Imms
2022-05-11 08:37:42 -07:00
parent abdce874db
commit c0b4edaf31
7 changed files with 50 additions and 58 deletions
+3 -8
View File
@@ -179,14 +179,9 @@ export class TextRenderLayer extends BaseRenderLayer {
// Get any decoration foreground/background overrides, this must be fetched before the early
// exist but applied after inverse
const decorations = this._decorationService.getDecorationsOnLine(this._bufferService.buffer.ydisp + y);
for (const d of decorations) {
const xmin = d.options.x ?? 0;
const xmax = xmin + (d.options.width ?? 1);
if (x >= xmin && x < xmax) {
if (d.backgroundColorRGB) {
nextFillStyle = d.backgroundColorRGB.css;
}
for (const d of this._decorationService.getDecorationsAtCell(x, this._bufferService.buffer.ydisp + y)) {
if (d.backgroundColorRGB) {
nextFillStyle = d.backgroundColorRGB.css;
}
}