Remove unused _decorationElements

This commit is contained in:
Daniel Imms
2022-04-01 07:07:13 -07:00
parent 7eace4d479
commit 8158a16629
@@ -33,7 +33,6 @@ const drawX = {
export class OverviewRulerRenderer extends Disposable {
private readonly _canvas: HTMLCanvasElement;
private readonly _ctx: CanvasRenderingContext2D;
private readonly _decorationElements: Map<IInternalDecoration, HTMLElement> = new Map();
private readonly _colorZoneStore: IColorZoneStore = new ColorZoneStore();
private get _width(): number {
return this._optionsService.options.overviewRulerWidth || 0;
@@ -75,7 +74,6 @@ export class OverviewRulerRenderer extends Disposable {
*/
private _registerDecorationListeners(): void {
this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(undefined, true)));
this.register(this._decorationService.onDecorationRemoved(decoration => this._removeDecoration(decoration)));
}
/**
@@ -120,10 +118,6 @@ export class OverviewRulerRenderer extends Disposable {
}
public override dispose(): void {
for (const decoration of this._decorationElements) {
decoration[0].dispose();
}
this._decorationElements.clear();
this._canvas?.remove();
super.dispose();
}
@@ -221,9 +215,4 @@ export class OverviewRulerRenderer extends Disposable {
this._animationFrame = undefined;
});
}
private _removeDecoration(decoration: IInternalDecoration): void {
this._decorationElements.get(decoration)?.remove();
this._decorationElements.delete(decoration);
}
}