Allow for situation where we get a move event to attach a shadow.

This happens after adding a custom procedure input to an existing custom procedure call block.
This commit is contained in:
Paul Kaplan 2019-03-11 14:52:40 -04:00
parent 19a4329c8b
commit 2b53b8b647
2 changed files with 43 additions and 0 deletions
src/engine

View file

@ -735,6 +735,12 @@ class Blocks {
if (this._blocks[e.newParent].inputs.hasOwnProperty(e.newInput)) {
oldShadow = this._blocks[e.newParent].inputs[e.newInput].shadow;
}
// If the block being attached is itself a shadow, make sure to set
// both block and shadow to that blocks ID. This happens when adding
// inputs to a custom procedure.
if (this._blocks[e.id].shadow) oldShadow = e.id;
this._blocks[e.newParent].inputs[e.newInput] = {
name: e.newInput,
block: e.id,