From 8ebf94dabd27c57455a72d706b95a2d8c998a82e Mon Sep 17 00:00:00 2001 From: Luke Westby Date: Fri, 25 Sep 2015 15:33:26 -0500 Subject: [PATCH] Fix: calling set with same value twice breaks update When you push a value that is equal to the prior value when truncated to an integer, the call to `clearInterval()` never happens so further updates are continually overwritten by the interval that was never cleared. This allows for values that are equal to pass through and clear the previous interval. --- javascripts/dashing.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index 20a99874..649ea464 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -83,7 +83,7 @@ Dashing.AnimatedValue = @[timer] = setInterval => num = if up then Math.ceil(num+num_interval) else Math.floor(num-num_interval) - if (up && num > to) || (!up && num < to) + if (up && num >= to) || (!up && num <= to) num = to clearInterval(@[timer]) @[timer] = null