From 28b2b38d82f0cebdf54d58635ebf3c537fd65c72 Mon Sep 17 00:00:00 2001 From: Gavin McDonald Date: Thu, 7 Feb 2019 19:58:14 -0500 Subject: [PATCH] reduce transparency on pip edge and allow for adjusting pip transparency as a whole --- src/drawShapes.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drawShapes.js b/src/drawShapes.js index 0cecd99..dcd5882 100644 --- a/src/drawShapes.js +++ b/src/drawShapes.js @@ -41,7 +41,7 @@ const DEFAULTS = { red: 255, blue: 255, green: 255, - alpha: 0.8, + alpha: 0.9, }, }, body: { @@ -211,7 +211,7 @@ export default class DrawShapes { }); } - pips (context, scale, x, y, cell) { + pips (context, scale, x, y, cell, alpha = 1) { const {tileStyle, orientation, pips} = cell; if (this.pipVertices[tileStyle] @@ -225,7 +225,9 @@ export default class DrawShapes { const scaleWidth = (scale * 2) * cell.scale; const scaleHeight = (scale * 2) * cell.scale; + context.globalAlpha = alpha; context.drawImage(this.pipCache.pips[pips], x - (scaleWidth / 2), y - (scaleHeight / 2), scaleWidth, scaleHeight); + context.globalAlpha = 1; } }