MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / NumberController

Function NumberController

MathBox/dat.gui.js:691–719  ·  view source on GitHub ↗
(object, property, params)

Source from the content-addressed store, hash-verified

689 * @member dat.controllers
690 */
691 var NumberController = function(object, property, params) {
692
693 NumberController.superclass.call(this, object, property);
694
695 params = params || {};
696
697 this.__min = params.min;
698 this.__max = params.max;
699 this.__step = params.step;
700
701 if (common.isUndefined(this.__step)) {
702
703 if (this.initialValue == 0) {
704 this.__impliedStep = 1; // What are we, psychics?
705 } else {
706 // Hey Doug, check this out.
707 this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue))/Math.LN10))/10;
708 }
709
710 } else {
711
712 this.__impliedStep = this.__step;
713
714 }
715
716 this.__precision = numDecimals(this.__impliedStep);
717
718
719 };
720
721 NumberController.superclass = Controller;
722

Callers

nothing calls this directly

Calls 1

numDecimalsFunction · 0.85

Tested by

no test coverage detected