diff --git a/resources/docs/user-guide/widgets-specifics/pads.md b/resources/docs/user-guide/widgets-specifics/pads.md index 535d2efb..394c89a8 100644 --- a/resources/docs/user-guide/widgets-specifics/pads.md +++ b/resources/docs/user-guide/widgets-specifics/pads.md @@ -47,7 +47,7 @@ Pads are multidimensional widgets that output multiple values. - default: `false` - usage: - set to `true` to send separate osc messages for `x` and `y` axis. The `address` will be the same as the widget's with `/x` or `/y` appended to it - - can be set as an object to specify a different `address` : `{x:'/osc_address_x', y:'/osc_address_y'}` + - can be set as an object to specify a different `address` : `['/osc_address_x', '/osc_address_y']` - note: the widget will only respond to its original osc address, not to the splitted version ---- @@ -99,7 +99,7 @@ Pads are multidimensional widgets that output multiple values. - default: `false` - usage: - set to `true` to send separate osc messages for each point's `x` and `y` axis. The `address` will be the same as the widget's with `/N/x` or `/N/y` appended to it, where `N` is the point's id. - - can be set as an object to specify a different `address` : `{0:'/osc_address/0', 1:'/osc_address_/1'}` (each address will be appended `/x` or `y`) + - can be set as an object to specify a different `address` : `['/0/x', '/0/y', '/1/x', '/2/y']` - note: the widget will only respond to its original osc address, not to the splitted version #### `snap` @@ -134,4 +134,4 @@ RGB is a variant of XY, it outputs rgb values between 0 and 255. - default: `false` - usage: - set to `true` to send separate osc messages for `r` and `g` & `b`. The `address` will be the same as the widget's with `/r`, `/g` or `/b` appended to it - - can be set as an object to specify a different `address` : `{r:'/osc_address_r', g:'/osc_address_g',b:'/osc_address_b'}` + - can be set as an object to specify a different `address` : `['/r', '/b', '/b']` diff --git a/src/browser/js/app/widgets/pads/multixy.js b/src/browser/js/app/widgets/pads/multixy.js index 4db58b43..8a403d32 100644 --- a/src/browser/js/app/widgets/pads/multixy.js +++ b/src/browser/js/app/widgets/pads/multixy.js @@ -52,7 +52,7 @@ module.exports = class MultiXy extends _pads_base { this.widget[0].style.setProperty("--point-size",this.pointSize + 'rem') this.split = widgetData.split? - typeof widgetData.split == 'object'? + typeof widgetData.split == 'object' && widgetData.split.length == 2 * widgetData.points ? widgetData.split : (()=>{ var s={}; diff --git a/src/browser/js/app/widgets/pads/rgb.js b/src/browser/js/app/widgets/pads/rgb.js index 38011a06..8dd31368 100644 --- a/src/browser/js/app/widgets/pads/rgb.js +++ b/src/browser/js/app/widgets/pads/rgb.js @@ -42,9 +42,9 @@ module.exports = class Rgb extends _pads_base { super(...arguments) this.split = widgetData.split? - typeof widgetData.split == 'object'? + typeof widgetData.split == 'object' && widgetData.split.length == 3 ? widgetData.split - : {r: widgetData.address + '/r', g: widgetData.address + '/g', b: widgetData.address + '/b'} + : [widgetData.address + '/r', widgetData.address + '/g', widgetData.address + '/b'] : false this.widget.append(` diff --git a/src/browser/js/app/widgets/pads/xy.js b/src/browser/js/app/widgets/pads/xy.js index ecd3ced7..913d96ba 100644 --- a/src/browser/js/app/widgets/pads/xy.js +++ b/src/browser/js/app/widgets/pads/xy.js @@ -47,9 +47,9 @@ module.exports = class Xy extends _pads_base { super(...arguments) this.split = widgetData.split? - typeof widgetData.split == 'object'? + typeof widgetData.split == 'object' && widgetData.split.length == 2 ? widgetData.split - : {x: widgetData.address + '/x', y: widgetData.address + '/y'} + : [widgetData.address + '/x', widgetData.address + '/y'] : false this.widget.append(`