From 8b540c5f3b6bc6a020b3aba6e1ef407e86d9fedb Mon Sep 17 00:00:00 2001 From: meganrogge Date: Mon, 7 Feb 2022 16:37:34 -0600 Subject: [PATCH] set initial top value --- src/browser/services/DecorationsService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/browser/services/DecorationsService.ts b/src/browser/services/DecorationsService.ts index 6bac2fea..ff617cb1 100644 --- a/src/browser/services/DecorationsService.ts +++ b/src/browser/services/DecorationsService.ts @@ -28,14 +28,13 @@ export class DecorationsService extends Disposable implements IDecorationsServic @IRenderService private readonly _renderService: IRenderService ) { super(); - this._renderService.onRefreshRequest(() => this._refresh()); } public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined { if (decorationOptions.marker.isDisposed) { return undefined; } - const bufferDecoration = new BufferDecoration(decorationOptions, this._screenElement, this._renderService); + const bufferDecoration = new BufferDecoration(decorationOptions, this._screenElement, this._renderService, this._bufferService); this._decorations.push(bufferDecoration); return bufferDecoration; } @@ -89,7 +88,8 @@ class BufferDecoration extends Disposable implements IDecoration { constructor( private readonly _decorationOptions: IBufferDecorationOptions, private readonly _screenElement: HTMLElement, - private readonly _renderService: IRenderService + private readonly _renderService: IRenderService, + private readonly _bufferService: IBufferService ) { super(); this._marker = _decorationOptions.marker; @@ -114,7 +114,7 @@ class BufferDecoration extends Disposable implements IDecoration { this._resolveDimensions(); this._element.style.width = `${this._decorationOptions.width}px`; this._element.style.height = `${this._decorationOptions.height}px`; - + this._element.style.top = `${(this.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.scaledCellHeight}px`; if (this._decorationOptions.x && this._decorationOptions.x < 0) { throw new Error(`Decoration options x value cannot be negative, but was ${this._decorationOptions.x}`); }