lo-th / uil

simple javascript ui
http://lo-th.github.io/uil/
MIT License
556 stars 50 forks source link

Graph.setValue needs to update internals #27

Closed ndahn closed 3 years ago

ndahn commented 3 years ago

Graph.setValue() is inherited, so it only updates Graph.value. But it also needs to update Graph.v and Graph.lng, otherwise the graphics won't be updated. Could be done the same way as in the constructor, i.e.

this.value = value;
this.lng = value.length;
for (var i = 0; i < this.lng; i++) {
    if (this.neg) _this.v[i] = (1 + value[i] / this.multiplicator) * 0.5;
    else this.v[i] = value[i] / this.multiplicator;
}
lo-th commented 3 years ago

Ok is fixed