Fix decoration positioning
In _createElement the element wasn't set on the decoration yet. Fixes 3818
This commit is contained in:
@@ -84,7 +84,7 @@ export class BufferDecorationRenderer extends Disposable {
|
|||||||
// exceeded the container width, so hide
|
// exceeded the container width, so hide
|
||||||
element.style.display = 'none';
|
element.style.display = 'none';
|
||||||
}
|
}
|
||||||
this._refreshXPosition(decoration);
|
this._refreshXPosition(decoration, element);
|
||||||
|
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
@@ -112,15 +112,15 @@ export class BufferDecorationRenderer extends Disposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _refreshXPosition(decoration: IInternalDecoration): void {
|
private _refreshXPosition(decoration: IInternalDecoration, element: HTMLElement | undefined = decoration.element): void {
|
||||||
if (!decoration.element) {
|
if (!element) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const x = decoration.options.x ?? 0;
|
const x = decoration.options.x ?? 0;
|
||||||
if ((decoration.options.anchor || 'left') === 'right') {
|
if ((decoration.options.anchor || 'left') === 'right') {
|
||||||
decoration.element.style.right = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';
|
element.style.right = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';
|
||||||
} else {
|
} else {
|
||||||
decoration.element.style.left = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';
|
element.style.left = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user