mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Check for getter and setter methods of direct access fails
This commit is contained in:
parent
f5ef4a374f
commit
1fd9084574
@ -134,12 +134,12 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.min.js'><strong>Download the minified source</strong></a>
|
<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.min.js'><strong>Download the minified source</strong></a>
|
||||||
<small id='buildsizemin'>[19.5kb]
|
<small id='buildsizemin'>[19.6kb]
|
||||||
</small>
|
</small>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.js'><strong>Download the uncompressed source</strong></a>
|
<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.js'><strong>Download the uncompressed source</strong></a>
|
||||||
<small id='buildsize'>[33.6kb]
|
<small id='buildsize'>[33.8kb]
|
||||||
</small>
|
</small>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -42,7 +42,13 @@ DAT.GUI.Controller.prototype.unlisten = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
DAT.GUI.Controller.prototype.setValue = function(n) {
|
DAT.GUI.Controller.prototype.setValue = function(n) {
|
||||||
this.object[this.propertyName] = n;
|
if(this.object[this.propertyName]){
|
||||||
|
this.object[this.propertyName] = n;
|
||||||
|
}else{
|
||||||
|
var o = new Object();
|
||||||
|
o[this.propertyName] = n;
|
||||||
|
this.object.set(o);
|
||||||
|
}
|
||||||
if (this.changeFunction != null) {
|
if (this.changeFunction != null) {
|
||||||
this.changeFunction.call(this, n);
|
this.changeFunction.call(this, n);
|
||||||
}
|
}
|
||||||
@ -51,7 +57,8 @@ DAT.GUI.Controller.prototype.setValue = function(n) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
DAT.GUI.Controller.prototype.getValue = function() {
|
DAT.GUI.Controller.prototype.getValue = function() {
|
||||||
return this.object[this.propertyName];
|
var val = this.object[this.propertyName] || this.object.get(this.propertyName);
|
||||||
|
return val;
|
||||||
};
|
};
|
||||||
|
|
||||||
DAT.GUI.Controller.prototype.updateDisplay = function() {
|
DAT.GUI.Controller.prototype.updateDisplay = function() {
|
||||||
|
@ -306,7 +306,7 @@ DAT.GUI = function(parameters) {
|
|||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var value = object[propertyName];
|
var value = object[propertyName] || (object.get && object.get(propertyName));
|
||||||
|
|
||||||
// Does this value exist? Is it accessible?
|
// Does this value exist? Is it accessible?
|
||||||
if (value == undefined) {
|
if (value == undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user