From ee3442ca16ecde24128e0c7fb6fc7602e8c7d31a Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Tue, 27 Sep 2016 17:50:52 -0500 Subject: [PATCH] Update globalAlpha when stamping. Fixes #664 WIP #664 Record the originalAlpha and reset --- objects.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/objects.js b/objects.js index 56a9e1bc..7c6bf126 100644 --- a/objects.js +++ b/objects.js @@ -3050,17 +3050,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) {