From 0fa09c5de9ceef484dbc716f96bb15e13cf664a9 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:08:58 +1100 Subject: [PATCH] Hopefully fix the overlapping this time --- src/components/CanvasBuilder.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/CanvasBuilder.ts b/src/components/CanvasBuilder.ts index 0b72e94..c09cdca 100644 --- a/src/components/CanvasBuilder.ts +++ b/src/components/CanvasBuilder.ts @@ -29,10 +29,11 @@ export default class CanvasBuilder { const origin = [15, 65]; const size = [1300, 630]; const nodeWidth = size[0] / (data.length - 1); - if (type === 'leaderboard') this.ctx.globalAlpha = 0; + this.ctx.globalAlpha = 0; + this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); this.ctx.fillStyle = this.palette.background; this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height); - if (type === 'leaderboard') this.ctx.globalAlpha = 1; + this.ctx.globalAlpha = 1; // Grey horizontal lines this.ctx.lineWidth = 5;