Skip to content

Commit

Permalink
#46 - explicitly converted all vars to numbers in refresh method
Browse files Browse the repository at this point in the history
  • Loading branch information
toorshia committed Apr 1, 2013
1 parent 8d3bc15 commit b34fb0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit b34fb0f

Please sign in to comment.