From 6b26a1bcf8bda287b269884df80ba8f8206bf489 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 1 Apr 2022 06:05:30 -0700 Subject: [PATCH] Stick to integers for padding and render full after --- .../Decorations/OverviewRulerRenderer.ts | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/browser/Decorations/OverviewRulerRenderer.ts b/src/browser/Decorations/OverviewRulerRenderer.ts index d2ffdc2d2..de2342f1f 100644 --- a/src/browser/Decorations/OverviewRulerRenderer.ts +++ b/src/browser/Decorations/OverviewRulerRenderer.ts @@ -150,10 +150,10 @@ export class OverviewRulerRenderer extends Disposable { private _refreshColorZonePadding(): void { this._colorZoneStore.setPadding({ - full: this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.full / 2), - left: this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.left / 2), - center: this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.center / 2), - right: this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.right / 2) + full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.full / 2)), + left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.left / 2)), + center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.center / 2)), + right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * (drawHeight.right / 2)) }); this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length; } @@ -177,8 +177,16 @@ export class OverviewRulerRenderer extends Disposable { this._colorZoneStore.addDecoration(decoration); } this._ctx.lineWidth = 1; - for (const zone of this._colorZoneStore.zones) { - this._renderColorZone(zone); + const zones = this._colorZoneStore.zones; + for (const zone of zones) { + if (zone.position !== 'full') { + this._renderColorZone(zone); + } + } + for (const zone of zones) { + if (zone.position === 'full') { + this._renderColorZone(zone); + } } this._shouldUpdateDimensions = false; this._shouldUpdateAnchor = false;