aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/slider.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/slider.js b/ui/slider.js
index 24ab6e167..5ee9c8236 100644
--- a/ui/slider.js
+++ b/ui/slider.js
@@ -552,8 +552,13 @@ return $.widget( "ui.slider", $.ui.mouse, {
var max = this.options.max,
min = this._valueMin(),
step = this.options.step,
- aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
+ aboveMin = Math.round( ( max - min ) / step ) * step;
max = aboveMin + min;
+ if ( max > this.options.max ) {
+
+ //If max is not divisible by step, rounding off may increase its value
+ max -= step;
+ }
this.max = parseFloat( max.toFixed( this._precision() ) );
},