From 132553f521f9cb8cc1decf2a037f37b4b3ebb0ec Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 4 Jul 2024 08:37:48 -0700 Subject: [PATCH] Sync DOM decoration styles when line height/width changes See microsoft/vscode#219979 --- src/browser/decorations/BufferDecorationRenderer.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/browser/decorations/BufferDecorationRenderer.ts b/src/browser/decorations/BufferDecorationRenderer.ts index 6ba9ae1ece..aca1e5daf8 100644 --- a/src/browser/decorations/BufferDecorationRenderer.ts +++ b/src/browser/decorations/BufferDecorationRenderer.ts @@ -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); } }