mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Fix sprite not drawing after being added
This commit is contained in:
parent
8dc94391b0
commit
c891268672
1 changed files with 3 additions and 2 deletions
|
@ -184,11 +184,12 @@ class VirtualMachine extends EventEmitter {
|
|||
* @param {string} json JSON string representing the sprite.
|
||||
*/
|
||||
addSprite2 (json) {
|
||||
// Select new sprite.
|
||||
sb2import(json, this.runtime, true).then(targets => {
|
||||
this.runtime.targets.push(targets[0]);
|
||||
this.editingTarget = targets[0];
|
||||
// Update the VM user's knowledge of targets and blocks on the workspace.
|
||||
this.editingTarget.updateAllDrawableProperties();
|
||||
|
||||
// Update the VM user's knowledge of targets and blocks on the workspace.
|
||||
this.emitTargetsUpdate();
|
||||
this.emitWorkspaceUpdate();
|
||||
this.runtime.setEditingTarget(this.editingTarget);
|
||||
|
|
Loading…
Reference in a new issue