diff --git a/src/sprites/rendered-target.js b/src/sprites/rendered-target.js index adf945739..e062df53f 100644 --- a/src/sprites/rendered-target.js +++ b/src/sprites/rendered-target.js @@ -706,9 +706,10 @@ RenderedTarget.prototype.onGreenFlag = function () { /** * Called when the project receives a "stop all" - * Stop all sounds + * Stop all sounds and clear graphic effects. */ RenderedTarget.prototype.onStopAll = function () { + this.clearEffects(); if (this.audioPlayer) { this.audioPlayer.stopAllSounds(); this.audioPlayer.clearEffects(); diff --git a/test/unit/sprites_rendered-target.js b/test/unit/sprites_rendered-target.js index 58c61bdf7..3ff40e2cd 100644 --- a/test/unit/sprites_rendered-target.js +++ b/test/unit/sprites_rendered-target.js @@ -11,3 +11,13 @@ test('clone effects', function (t) { t.ok(a.effects !== b.effects); t.end(); }); + +test('#stopAll clears graphics effects', function (t) { + var spr = new Sprite(); + var a = new RenderedTarget(spr, null); + var effectName = 'brightness'; + a.setEffect(effectName, 100); + a.onStopAll(); + t.equals(a.effects[effectName], 0); + t.end(); +});