editor: update comments
This commit is contained in:
parent
e98da4c01d
commit
6e7ada7c45
1 changed files with 5 additions and 1 deletions
|
|
@ -16,7 +16,6 @@ function updateWidget(widget, options={}) {
|
|||
|
||||
if (options.changedProps) {
|
||||
// alternate routine for small edits
|
||||
// if props/osc-listeners are modified -> full rebuild instead
|
||||
var propNames = options.changedProps,
|
||||
propValues = propNames.map(x => widget.props[x]),
|
||||
linkedProps = []
|
||||
|
|
@ -26,12 +25,15 @@ function updateWidget(widget, options={}) {
|
|||
Object.values(widget.oscReceivers).forEach(r => linkedProps = linkedProps.concat(r.propNames))
|
||||
|
||||
if (
|
||||
// if non dynamic props have changed, skip this and use rebuild routine
|
||||
!propNames.some(n => !widget.constructor.dynamicProps.includes(n))
|
||||
) {
|
||||
|
||||
var edited = widget.updateProps(options.changedProps, null) || widget
|
||||
|
||||
if (
|
||||
// if prop/osc listeners have changed (@{} / OSC{})
|
||||
// refresh the widget's props cache and update linked props bindings
|
||||
!propValues.some(x => typeof x === 'string' && x.match(/OSC\{|@\{/))
|
||||
&& !propNames.some(n => linkedProps.includes(n))
|
||||
) {
|
||||
|
|
@ -41,7 +43,9 @@ function updateWidget(widget, options={}) {
|
|||
if (editor.selectedWidgets.includes(widget) && !options.preventSelect) {
|
||||
editor.select(edited)
|
||||
}
|
||||
|
||||
return edited
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue