Skip to content

Commit 00b31be

Browse files
committed
Allow adding arrays with dynamic patching
1 parent 9df9b05 commit 00b31be

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Source/Canvas.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,6 +2690,21 @@ void Canvas::receiveMessage(t_symbol* symbol, SmallArray<pd::Atom> const& atoms)
26902690
synchronise();
26912691
break;
26922692
}
2693+
case hash("array"): {
2694+
if(isGraph) {
2695+
// Async because this will destroy the current canvas, which the caller might be in the middle of using
2696+
MessageManager::callAsync([_this = SafePointer<Canvas>(this)](){
2697+
if(!_this) return;
2698+
if(auto* object = _this->findParentComponentOfClass<Object>())
2699+
{
2700+
_this->setSelected(object, false);
2701+
_this->editor->sidebar->hideParameters();
2702+
object->setType(object->gui->getText(), object->gui->ptr);
2703+
}
2704+
});
2705+
}
2706+
break;
2707+
}
26932708
case hash("editmode"): {
26942709
if (::getValue<bool>(commandLocked))
26952710
return;

0 commit comments

Comments
 (0)