Align full with other decorations

Fixes #3692
This commit is contained in:
Daniel Imms
2022-03-18 10:54:11 -07:00
parent 816220ebd2
commit 77622f8919
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -559,5 +559,7 @@ function addOverviewRuler() {
term.registerDecoration({marker: term.addMarker(7), overviewRulerOptions: { color: '#ef2929', position: 'left' }});
term.registerDecoration({marker: term.addMarker(7), overviewRulerOptions: { color: '#8ae234', position: 'center' }});
term.registerDecoration({marker: term.addMarker(7), overviewRulerOptions: { color: '#729fcf', position: 'right' }});
term.registerDecoration({marker: term.addMarker(10), overviewRulerOptions: { color: '#8ae234', position: 'center' }});
term.registerDecoration({marker: term.addMarker(10), overviewRulerOptions: { color: '#ffffff80', position: 'full' }});
}
@@ -135,7 +135,10 @@ export class OverviewRulerRenderer extends Disposable {
this._ctx.fillStyle = decoration.options.overviewRulerOptions.color;
this._ctx.fillRect(
/* x */ drawX[decoration.options.overviewRulerOptions.position!],
/* y */ Math.round(this._canvas.height * (decoration.options.marker.line / this._bufferService.buffers.active.lines.length)),
/* y */ Math.round(
(this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line
(decoration.options.marker.line / this._bufferService.buffers.active.lines.length) - drawHeight[decoration.options.overviewRulerOptions.position!] / 2
),
/* w */ drawWidth[decoration.options.overviewRulerOptions.position!],
/* h */ drawHeight[decoration.options.overviewRulerOptions.position!]
);