Permalink
Browse files

Merge pull request #45 from hackerceo/master

Fix Divide by Zero bug in translateToPx()
  • Loading branch information...
madrobby committed Jun 18, 2015
2 parents 1e63ff3 + 5d67466 commit ae999c943e468df4b3f39283745b1e3f99468d29
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/slider.js
View
@@ -148,6 +148,7 @@ Control.Slider = Class.create({
handleIdx || this.activeHandleIdx || 0);
},
translateToPx: function(value) {
if ((this.range.end-this.range.start)==0) { return "0px"; }
return Math.round(
((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) *
(value - this.range.start)) + "px";

0 comments on commit ae999c9

Please sign in to comment.