From 0556bcfe0df768507dd9fb06ee9a6186305affe3 Mon Sep 17 00:00:00 2001 From: Nathan Dinsmore Date: Wed, 14 May 2014 03:07:16 -0400 Subject: [PATCH 1/2] Fixed shadow disappearing when a script runs while being dragged --- src/blocks/Block.as | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/blocks/Block.as b/src/blocks/Block.as index 418ce24..3343d67 100644 --- a/src/blocks/Block.as +++ b/src/blocks/Block.as @@ -298,13 +298,22 @@ public class Block extends Sprite { } public function showRunFeedback():void { - if (!filters || (filters.length == 0)) { - filters = runFeedbackFilters(); + if (filters.length > 0) { + for each (var f:* in filters) { + if (f is GlowFilter) return; + } } + filters = runFeedbackFilters().concat(filters || []); } public function hideRunFeedback():void { - if (filters && (filters.length > 0)) filters = []; + if (filters && filters.length > 0) { + var newFilters:Array = []; + for each (var f:* in filters) { + if (!(f is GlowFilter)) newFilters.push(f); + } + filters = newFilters; + } } private function runFeedbackFilters():Array { From 34aac1b158a5469412d91fb03ce9476a6768e81a Mon Sep 17 00:00:00 2001 From: Nathan Dinsmore Date: Wed, 18 Jun 2014 09:50:42 -0400 Subject: [PATCH 2/2] Check that `filters` is truthy --- src/blocks/Block.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/Block.as b/src/blocks/Block.as index 3343d67..25361bb 100644 --- a/src/blocks/Block.as +++ b/src/blocks/Block.as @@ -298,7 +298,7 @@ public class Block extends Sprite { } public function showRunFeedback():void { - if (filters.length > 0) { + if (filters && filters.length > 0) { for each (var f:* in filters) { if (f is GlowFilter) return; }