Merge pull request #1434 from brollb/664-stamp-ignores-ghost-effect

Update globalAlpha when stamping. Fixes #664
dev
Jens Mönig 2016-10-16 17:30:27 +02:00 zatwierdzone przez GitHub
commit 23c68a72c6
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -3054,17 +3054,21 @@ SpriteMorph.prototype.overlappingImage = function (otherSprite) {
SpriteMorph.prototype.doStamp = function () {
var stage = this.parent,
context = stage.penTrails().getContext('2d'),
isWarped = this.isWarped;
isWarped = this.isWarped,
originalAlpha = context.globalAlpha;
if (isWarped) {
this.endWarp();
}
context.save();
context.scale(1 / stage.scale, 1 / stage.scale);
context.globalAlpha = this.alpha;
context.drawImage(
this.image,
(this.left() - stage.left()),
(this.top() - stage.top())
);
context.globalAlpha = originalAlpha;
context.restore();
this.changed();
if (isWarped) {