mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 07:22:33 -05:00
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.
This commit is contained in:
parent
aecc3bf893
commit
2ba177aa0f
1 changed files with 3 additions and 0 deletions
|
@ -147,6 +147,7 @@ Scratch3PenBlocks.prototype._updatePenColor = function (penState) {
|
||||||
penState.penAttributes.color4f[0] = rgb.r / 255.0;
|
penState.penAttributes.color4f[0] = rgb.r / 255.0;
|
||||||
penState.penAttributes.color4f[1] = rgb.g / 255.0;
|
penState.penAttributes.color4f[1] = rgb.g / 255.0;
|
||||||
penState.penAttributes.color4f[2] = rgb.b / 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;
|
penState.penAttributes.color4f[2] = rgb.b / 255.0;
|
||||||
if (rgb.hasOwnProperty('a')) { // Will there always be an 'a'?
|
if (rgb.hasOwnProperty('a')) { // Will there always be an 'a'?
|
||||||
penState.penAttributes.color4f[3] = rgb.a / 255.0;
|
penState.penAttributes.color4f[3] = rgb.a / 255.0;
|
||||||
|
} else {
|
||||||
|
penState.penAttributes.color4f[3] = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue