From 46cda567015355d8089008c93d001345b5f0420a Mon Sep 17 00:00:00 2001 From: cgeorg Date: Mon, 11 Aug 2014 17:10:01 -0400 Subject: [PATCH 1/2] Set the number of events to delete correctly The code was only freeing up to 20 or so events, depending on how many particles the last non-visible event had. Correctly setting the index to delete-up-to to be the highest non-visible event. --- js/detector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/detector.js b/js/detector.js index 91f5ff8..493f81f 100644 --- a/js/detector.js +++ b/js/detector.js @@ -297,7 +297,7 @@ var detector = if (detector.events.list[e].alpha > 0) { detector.events.list[e].draw(duration); } else { - del = detector.events.list[e].count; + del = e; } } From ff9515c27771619a6d731bb132091d388b3c1766 Mon Sep 17 00:00:00 2001 From: cgeorg Date: Tue, 12 Aug 2014 07:15:13 -0400 Subject: [PATCH 2/2] Only splice if there's something to remove --- js/detector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/detector.js b/js/detector.js index 493f81f..9f822cb 100644 --- a/js/detector.js +++ b/js/detector.js @@ -301,7 +301,7 @@ var detector = } } - if (del >= 0) { + if (del > 0) { detector.events.list.splice(0, del); } }