From d11136f2e009a646f4b93dc88cf1c96d2a019033 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Mouret Date: Mon, 22 Sep 2014 14:43:57 +0800 Subject: [PATCH] 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. --- src/dat/controllers/NumberController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dat/controllers/NumberController.js b/src/dat/controllers/NumberController.js index 294e36c..4cab081 100644 --- a/src/dat/controllers/NumberController.js +++ b/src/dat/controllers/NumberController.js @@ -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; -}); \ No newline at end of file +});