Handling zoom handle left position as a floating-point number for better accuracy...
authorPaul Felix <paul.eric.felix@gmail.com>
Thu, 6 Sep 2012 13:24:58 +0000 (09:24 -0400)
committerDan Vanderkam <danvk@google.com>
Fri, 11 Jan 2013 22:01:32 +0000 (17:01 -0500)
plugins/range-selector.js

index b467377..e8c3efb 100644 (file)
@@ -846,8 +846,8 @@ rangeSelector.prototype.drawInteractiveLayer_ = function() {
  */
 rangeSelector.prototype.getZoomHandleStatus_ = function() {
   var halfHandleWidth = this.leftZoomHandle_.width/2;
-  var leftHandlePos = parseInt(this.leftZoomHandle_.style.left, 10) + halfHandleWidth;
-  var rightHandlePos = parseInt(this.rightZoomHandle_.style.left, 10) + halfHandleWidth;
+  var leftHandlePos = parseFloat(this.leftZoomHandle_.style.left) + halfHandleWidth;
+  var rightHandlePos = parseFloat(this.rightZoomHandle_.style.left) + halfHandleWidth;
   return {
       leftHandlePos: leftHandlePos,
       rightHandlePos: rightHandlePos,