mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Select the last target instead of the first
This commit is contained in:
parent
ecf535f4c3
commit
40345384aa
1 changed files with 2 additions and 1 deletions
|
@ -379,7 +379,8 @@ class VirtualMachine extends EventEmitter {
|
|||
this.runtime.disposeTarget(sprite.clones[i]);
|
||||
// Ensure editing target is switched if we are deleting it.
|
||||
if (clone === currentEditingTarget) {
|
||||
this.setEditingTarget(this.runtime.targets[0].id);
|
||||
const lastTargetIndex = this.runtime.targets.length - 1;
|
||||
this.setEditingTarget(this.runtime.targets[lastTargetIndex].id);
|
||||
}
|
||||
}
|
||||
// Sprite object should be deleted by GC.
|
||||
|
|
Loading…
Reference in a new issue