This is better

This commit is contained in:
Daniel Odendahl Jr
2018-04-17 19:29:18 +00:00
parent 3abd5c66c9
commit 9bb82d9575
+4 -2
View File
@@ -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) {