Skip to content

Commit

Permalink
Merge pull request #5088 from Tyriar/tyriar/dec
Browse files Browse the repository at this point in the history
Sync DOM decoration styles when line height/width changes
  • Loading branch information
Tyriar authored Jul 4, 2024
2 parents 795839c + 132553f commit 8927d5c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/browser/decorations/BufferDecorationRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ export class BufferDecorationRenderer extends Disposable {
element!.remove();
});
}
element.style.top = `${line * this._renderService.dimensions.css.cell.height}px`;
element.style.display = this._altBufferIsActive ? 'none' : 'block';
if (!this._altBufferIsActive) {
element.style.width = `${Math.round((decoration.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`;
element.style.height = `${(decoration.options.height || 1) * this._renderService.dimensions.css.cell.height}px`;
element.style.top = `${line * this._renderService.dimensions.css.cell.height}px`;
element.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`;
}
decoration.onRenderEmitter.fire(element);
}
}
Expand Down

0 comments on commit 8927d5c

Please sign in to comment.