From b34fb0fc58f37beba83775c6c7a050cf5af9d3bd Mon Sep 17 00:00:00 2001 From: Bojan Djuricic Date: Mon, 1 Apr 2013 17:35:51 +0200 Subject: [PATCH] #46 - explicitly converted all vars to numbers in refresh method --- justgage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/justgage.js b/justgage.js index 34582cc..0766db4 100644 --- a/justgage.js +++ b/justgage.js @@ -646,8 +646,8 @@ JustGage.prototype.refresh = function(val, max) { // overflow values originalVal = val; displayVal = val; - if (val > this.config.max) {val = this.config.max;} - if (val < this.config.min) {val = this.config.min;} + if ((val * 1) > (this.config.max * 1) {val = (this.config.max * 1);} + if ((val * 1) < (this.config.min * 1)) {val = (this.config.min * 1);} color = getColor(val, (val - this.config.min) / (this.config.max - this.config.min), this.config.levelColors, this.config.noGradient, this.config.customSectors); @@ -665,7 +665,7 @@ JustGage.prototype.refresh = function(val, max) { } this.canvas.getById(this.config.id+"-level").animate({pki: [val, this.config.min, this.config.max, this.params.widgetW, this.params.widgetH, this.params.dx, this.params.dy, this.config.gaugeWidthScale, this.config.donut], "fill":color}, this.config.refreshAnimationTime, this.config.refreshAnimationType); - this.config.value = val; + this.config.value = val * 1; // var clear originalVal, displayVal, color, max = null;