From aeb4fa0fe9da0d43fc10674aebd36ba4ada9433e Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 11 May 2022 10:15:18 -0700 Subject: [PATCH] Fix compile after bad merge --- .../Decorations/BufferDecorationRenderer.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/browser/Decorations/BufferDecorationRenderer.ts b/src/browser/Decorations/BufferDecorationRenderer.ts index f548750a..e695c824 100644 --- a/src/browser/Decorations/BufferDecorationRenderer.ts +++ b/src/browser/Decorations/BufferDecorationRenderer.ts @@ -66,7 +66,7 @@ export class BufferDecorationRenderer extends Disposable { private _renderDecoration(decoration: IInternalDecoration): void { this._refreshStyle(decoration); if (this._dimensionsChanged) { - this._refreshXPosition(decoration, element); + this._refreshXPosition(decoration); } } @@ -83,7 +83,7 @@ export class BufferDecorationRenderer extends Disposable { // exceeded the container width, so hide element.style.display = 'none'; } - this._refreshXPosition(decoration, element, x); + this._refreshXPosition(decoration); return element; } @@ -111,11 +111,15 @@ export class BufferDecorationRenderer extends Disposable { } } - private _refreshXPosition(decoration: IInternalDecoration, element: HTMLElement, x: number = decoration.options.x ?? 0): void { + private _refreshXPosition(decoration: IInternalDecoration): void { + if (!decoration.element) { + return; + } + const x = decoration.options.x ?? 0; if ((decoration.options.anchor || 'left') === 'right') { - element.style.right = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : ''; + decoration.element.style.right = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : ''; } else { - element.style.left = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : ''; + decoration.element.style.left = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : ''; } }