mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Merge branch 'dionysius-brach' of https://github.com/dionysiusmarquis/dat.gui into dionysiusmarquis-dionysius-brach
This commit is contained in:
commit
8d1ce070d6
@ -86,6 +86,8 @@ define([
|
||||
|
||||
function onMouseDrag(e) {
|
||||
|
||||
document.activeElement.blur();
|
||||
|
||||
var diff = prev_y - e.clientY;
|
||||
_this.setValue(_this.getValue() + diff * _this.__impliedStep);
|
||||
|
||||
@ -114,7 +116,7 @@ define([
|
||||
{
|
||||
|
||||
updateDisplay: function() {
|
||||
|
||||
if (dom.isActive(this.__input)) return;
|
||||
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||
return NumberControllerBox.superclass.prototype.updateDisplay.call(this);
|
||||
}
|
||||
|
@ -56,6 +56,8 @@ function(NumberController, dom, css, common, styleSheet) {
|
||||
|
||||
function onMouseDown(e) {
|
||||
|
||||
document.activeElement.blur();
|
||||
|
||||
dom.bind(window, 'mousemove', onMouseDrag);
|
||||
dom.bind(window, 'mouseup', onMouseUp);
|
||||
|
||||
|
@ -37,12 +37,18 @@ define([
|
||||
|
||||
if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {
|
||||
|
||||
// Has min and max.
|
||||
return new NumberControllerSlider(object, property, arguments[2], arguments[3]);
|
||||
// Has min and max.
|
||||
if (common.isNumber(arguments[4])) // has step
|
||||
return new NumberControllerSlider(object, property, arguments[2], arguments[3], arguments[4]);
|
||||
else
|
||||
return new NumberControllerSlider(object, property, arguments[2], arguments[3]);
|
||||
|
||||
} else {
|
||||
|
||||
return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });
|
||||
if (common.isNumber(arguments[4]))
|
||||
return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3], step: arguments[4] });
|
||||
else
|
||||
return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });
|
||||
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,8 @@
|
||||
background: #303030;
|
||||
cursor: ew-resize; }
|
||||
.dg .c .slider-fg {
|
||||
background: #2fa1d6; }
|
||||
background: #2fa1d6;
|
||||
max-width: 100%; }
|
||||
.dg .c .slider:hover {
|
||||
background: #3c3c3c; }
|
||||
.dg .c .slider:hover .slider-fg {
|
||||
|
Loading…
Reference in New Issue
Block a user