mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -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]);
|
this.runtime.disposeTarget(sprite.clones[i]);
|
||||||
// Ensure editing target is switched if we are deleting it.
|
// Ensure editing target is switched if we are deleting it.
|
||||||
if (clone === currentEditingTarget) {
|
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.
|
// Sprite object should be deleted by GC.
|
||||||
|
|
Loading…
Reference in a new issue