PDA

View Full Version : [FIXED][3.0 RC1] Slider and decimal increments



cbockermann
6 May 2009, 7:40 AM
In 3.0 RC1 I found Slider not to work correctly with non-integer increment values. The Slider always snaps to the next integer value.

The cause of the problem seems to be the onDrag() function in Slider, which uses the Ext.Math.round() function that always rounds to the next integer value. It should use the Ext.util.Format.round() and pass the decimalPrecision property of the Slider:

onDrag: function(e){
var pos = this.innerEl.translatePoints(this.tracker.getXY());
this.setValue(Ext.util.Format.round(this.reverseValue(pos.left), this.decimalPrecision), false);
this.fireEvent('drag', this, e);
}


Cheers

Carsten

evant
28 May 2009, 8:38 PM
Fixed in SVN, thanks.