From 9bb82d9575d971f08ddd6ef01dc37e72eb2346da Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 17 Apr 2018 19:29:18 +0000 Subject: [PATCH] This is better --- util/Canvas.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/Canvas.js b/util/Canvas.js index d2c40431..bce3b8bd 100644 --- a/util/Canvas.js +++ b/util/Canvas.js @@ -78,12 +78,14 @@ class CanvasUtil { } static drawImageWithTint(ctx, image, color, x, y, width, height) { + const fillStyle = ctx.fillStyle; + const globalAlpha = ctx.globalAlpha; ctx.fillStyle = color; ctx.drawImage(image, x, y, width, height); ctx.globalAlpha = 0.5; ctx.fillRect(x, y, width, height); - ctx.fillStyle = '#000000'; - ctx.globalAlpha = 1; + ctx.fillStyle = fillStyle; + ctx.globalAlpha = globalAlpha; } static shortenText(ctx, text, maxWidth) {