mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
add listener for on option change
This commit is contained in:
@@ -45,6 +45,11 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
this.register(addDisposableDomListener(window, 'resize', () => this.refreshDecorations()));
|
||||
this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh()));
|
||||
this.register(this._decorationService.onDecorationRemoved(decoration => this._removeDecoration(decoration)));
|
||||
this.register(this._optionsService.onOptionChange(o => {
|
||||
if (o === 'overviewRulerWidth') {
|
||||
this.refreshDecorations();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public override dispose(): void {
|
||||
@@ -85,9 +90,9 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
}
|
||||
|
||||
public refreshDecorations(): void {
|
||||
this._canvas.style.width = `${this._canvas.width || ScrollbarConstants.WIDTH}px`;
|
||||
this._canvas.style.width = `${this._optionsService.options.overviewRulerWidth || ScrollbarConstants.WIDTH}px`;
|
||||
this._canvas.style.height = `${this._screenElement.clientHeight}px`;
|
||||
this._canvas.width = Math.floor((this._canvas.width || ScrollbarConstants.WIDTH)* window.devicePixelRatio);
|
||||
this._canvas.width = Math.floor((this._optionsService.options.overviewRulerWidth || ScrollbarConstants.WIDTH)* window.devicePixelRatio);
|
||||
this._canvas.height = Math.floor(this._screenElement.clientHeight * window.devicePixelRatio);
|
||||
|
||||
for (const decoration of this._decorationService.decorations) {
|
||||
|
||||
Reference in New Issue
Block a user