Index: polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html |
diff --git a/polymer_1.0.4/bower_components/iron-range-behavior/iron-range-behavior.html b/polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html |
similarity index 80% |
copy from polymer_1.0.4/bower_components/iron-range-behavior/iron-range-behavior.html |
copy to polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html |
index d89843d3613707bdd60e224e7f639c10c05417f4..28469e9eaeb15a06e3e363d8c27e415b14de9648 100644 |
--- a/polymer_1.0.4/bower_components/iron-range-behavior/iron-range-behavior.html |
+++ b/polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html |
@@ -12,11 +12,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
<script> |
- /** |
+ /** |
* `iron-range-behavior` provides the behavior for something with a minimum to maximum range. |
* |
* @demo demo/index.html |
- * @polymerBehavior |
+ * @polymerBehavior |
*/ |
Polymer.IronRangeBehavior = { |
@@ -83,7 +83,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
}, |
_calcStep: function(value) { |
- return this.step ? (Math.round(value / this.step) / (1 / this.step)) : value; |
+ /** |
+ * if we calculate the step using |
+ * `Math.round(value / step) * step` we may hit a precision point issue |
+ * eg. 0.1 * 0.2 = 0.020000000000000004 |
+ * http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html |
+ * |
+ * as a work around we can divide by the reciprocal of `step` |
+ */ |
+ // polymer/issues/2493 |
+ value = parseFloat(value); |
+ return this.step ? (Math.round((value + this.min) / this.step) - |
+ (this.min / this.step)) / (1 / this.step) : value; |
}, |
_validateValue: function() { |