amrutabuge / dat-gui

Automatically exported from code.google.com/p/dat-gui
0 stars 0 forks source link

Initial negative numbers dragging crush #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up an initial number negative 
2. The implied step code will get to NaN since it uses a logarithm
3. When you drag the number it will get to NaN

I solved it making the absolute number before the logarithm.

Original issue reported on code.google.com by wkaele...@gmail.com on 17 Jun 2013 at 1:42

GoogleCodeExporter commented 9 years ago
See issue 23

Original comment by simole...@gmail.com on 16 Jul 2014 at 9:55

GoogleCodeExporter commented 9 years ago
Like this...
706: // Hey Doug, check this out.
707: this.__impliedStep = Math.pow(10, 
Math.floor(Math.log(Math.abs(this.initialValue))/Math.LN10))/10;

Also fixes problem where -0.1 initial value displays as zero.

Original comment by simole...@gmail.com on 16 Jul 2014 at 10:02