From 2ba177aa0f7e69e236c877ae6006ff97d61bdc7a Mon Sep 17 00:00:00 2001 From: griffpatch Date: Thu, 9 Feb 2017 08:50:37 +0000 Subject: [PATCH] Bug - Return pen opacity to opaque When setting the pen color using pen blocks, the opacity should be reset to fully opaque if no alpha is supplied. --- src/blocks/scratch3_pen.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/blocks/scratch3_pen.js b/src/blocks/scratch3_pen.js index c8f98341e..9b9f64919 100644 --- a/src/blocks/scratch3_pen.js +++ b/src/blocks/scratch3_pen.js @@ -147,6 +147,7 @@ Scratch3PenBlocks.prototype._updatePenColor = function (penState) { penState.penAttributes.color4f[0] = rgb.r / 255.0; penState.penAttributes.color4f[1] = rgb.g / 255.0; penState.penAttributes.color4f[2] = rgb.b / 255.0; + penState.penAttributes.color4f[3] = 1; }; /** @@ -260,6 +261,8 @@ Scratch3PenBlocks.prototype.setPenColorToColor = function (args, util) { penState.penAttributes.color4f[2] = rgb.b / 255.0; if (rgb.hasOwnProperty('a')) { // Will there always be an 'a'? penState.penAttributes.color4f[3] = rgb.a / 255.0; + } else { + penState.penAttributes.color4f[3] = 1; } };