pads: better value list validity check
This commit is contained in:
parent
b272990cae
commit
8915c43a45
3 changed files with 3 additions and 3 deletions
|
|
@ -222,7 +222,7 @@ module.exports = class MultiXy extends _pads_base {
|
|||
|
||||
setValue(v, options={}) {
|
||||
|
||||
if (!v || v.length!=this.npoints * 2) return
|
||||
if (!v || !v.length || v.length!=this.npoints * 2) return
|
||||
|
||||
for (var i=0;i<this.npoints;i++) {
|
||||
if (!options.dragged) {
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ module.exports = class Rgb extends _pads_base {
|
|||
|
||||
setValue(v, options={}) {
|
||||
|
||||
if (!v || v.length!=3) return
|
||||
if (!v || !v.length || v.length!=3) return
|
||||
|
||||
for (i in [0,1,2]) {
|
||||
v[i] = clip(v[i],[0,255])
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ module.exports = class Xy extends _pads_base {
|
|||
|
||||
setValue(v, options={}) {
|
||||
|
||||
if (!v || v.length!=2) return
|
||||
if (!v || !v.length || v.length!=2) return
|
||||
|
||||
if (!options.dragged) {
|
||||
this.faders.x.setValue(v[0], {sync: false, send:false, dragged:false})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue