Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/browser/Decorations/OverviewRulerRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class OverviewRulerRenderer extends Disposable {
return;
}
this._ctx.lineWidth = 1;
this._ctx.fillStyle = decoration.overviewRulerOptions?.color || decoration.options.overviewRulerOptions.color;
this._ctx.fillStyle = decoration.options.overviewRulerOptions.color;
this._ctx.fillRect(
decoration.options.overviewRulerOptions.position === 'full' || 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)),
Expand All @@ -113,15 +113,7 @@ export class OverviewRulerRenderer extends Disposable {
const element = this._decorationElements.get(decoration);
if (!element) {
this._decorationElements.set(decoration, this._canvas);
decoration.onDispose(() => {
this._ctx?.clearRect(
!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)),
!decoration!.options!.overviewRulerOptions?.position ? this._width : decoration!.options!.overviewRulerOptions?.position === 'center' ? renderSizes[SizeIndex.INNER_SIZE] : renderSizes[SizeIndex.OUTER_SIZE],
// when a position is provided, the element has less width, so increase its height
window.devicePixelRatio * (decoration!.options!.overviewRulerOptions?.position ? 6 : 2)
);
});
decoration.onDispose(() => this._queueRefresh());
}
this._refreshStyle(decoration, updateAnchor);
}
Expand Down