advanced syntax: update issue with clones using their own value in their properties

This commit is contained in:
jean-emmanuel 2023-05-13 11:07:13 +02:00
parent 5126125dba
commit 59689d8f16
2 changed files with 8 additions and 1 deletions

View file

@ -5,6 +5,8 @@
- bug fixes
- multixy: doubleTap not working on touch devices
- button: `x` and `y` variables not passed to `onValue` when `doubleTap` is true on touch devices
- advanced syntax: update issue with clones using their own value in their properties
## 1.24.2

View file

@ -45,12 +45,17 @@ class WidgetManager extends EventEmitter {
widgetsByLinkId = linkId ? this.getWidgetByLinkId(linkId) : []
// Widget that share the same id will update each other
// without sending any extra osc message
// without sending any extra osc message or running scripts
if (widgetsById.length > 1) {
let v = widget.getValue()
for (let i in widgetsById) {
if (widgetsById[i] !== widget) {
widgetsById[i].setValue(v,{send:false,sync:false, id})
// Because of sync:false, updated widgets that use @{this}
// in their properties wont update them, we trigger it manually
if (widgetsById[i].linkedPropsValue['this']) {
widgetsById[i].onLinkedPropsChanged({id, widget: widgetsById[i], options: {send: false, sync: false, id}}, 'value-changed')
}
}
}
}