mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
use options
This commit is contained in:
@@ -92,7 +92,7 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
return;
|
||||
}
|
||||
this._ctx.lineWidth = 1;
|
||||
this._ctx.fillStyle = decoration.overviewRulerDecorationColor || decoration.options.overviewRulerOptions.color;
|
||||
this._ctx.fillStyle = decoration.overviewRulerOptions?.color || decoration.options.overviewRulerOptions.color;
|
||||
this._ctx.fillRect(
|
||||
!decoration.options.overviewRulerOptions.position || decoration.options.overviewRulerOptions.position === 'left' ? 0 : decoration.options.overviewRulerOptions.position === 'right' ? renderSizes[SizeIndex.OUTER_SIZE] + renderSizes[SizeIndex.INNER_SIZE]: renderSizes[SizeIndex.OUTER_SIZE],
|
||||
Math.round(this._canvas.height * (decoration.options.marker.line / this._bufferService.buffers.active.lines.length)),
|
||||
|
||||
@@ -60,8 +60,6 @@ class Decoration extends Disposable implements IInternalDecoration {
|
||||
private _onDispose = this.register(new EventEmitter<void>());
|
||||
public readonly onDispose = this._onDispose.event;
|
||||
|
||||
public overviewRulerDecorationColor: string | undefined;
|
||||
|
||||
constructor(
|
||||
public readonly options: IDecorationOptions
|
||||
) {
|
||||
|
||||
Vendored
+9
-3
@@ -440,13 +440,19 @@ declare module 'xterm' {
|
||||
element: HTMLElement | undefined;
|
||||
|
||||
/**
|
||||
* The color to be used for the overview ruler decoration.
|
||||
* The options for the overview ruler that can be updated.
|
||||
* This will only take effect when @param overviewRulerOptions
|
||||
* were provided initially.
|
||||
*/
|
||||
overviewRulerDecorationColor: string | undefined;
|
||||
overviewRulerOptions?: IDecorationOverviewRulerOptions;
|
||||
}
|
||||
|
||||
|
||||
interface IDecorationOverviewRulerOptions {
|
||||
color: string;
|
||||
position?: 'left' | 'center' | 'right';
|
||||
}
|
||||
|
||||
/*
|
||||
* Options that define the presentation of the decoration.
|
||||
*/
|
||||
@@ -486,7 +492,7 @@ declare module 'xterm' {
|
||||
* @param color The color of the decoration.
|
||||
* @param position The position of the decoration.
|
||||
*/
|
||||
readonly overviewRulerOptions?: { color: string; position?: 'left' | 'center' | 'right'}
|
||||
overviewRulerOptions?: IDecorationOverviewRulerOptions
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user