Compute float implied step using the absolute of the input value.

Fix mouse drag setting the value to NaN if the initial value is negative.
This commit is contained in:
Jean-Sebastien Mouret 2014-09-22 14:43:57 +08:00
parent 072e945b32
commit d11136f2e0

View File

@ -46,7 +46,7 @@ define([
this.__impliedStep = 1; // What are we, psychics?
} else {
// Hey Doug, check this out.
this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue)/Math.LN10))/10;
this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue))/Math.LN10))/10;
}
} else {
@ -142,4 +142,4 @@ define([
return NumberController;
});
});