diff options
| author | jmoenig <jens@moenig.org> | 2014-07-11 17:14:35 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-07-11 17:14:35 +0200 |
| commit | f27e72e2b2005f96d680e12efb59aa146969d0ec (patch) | |
| tree | c8298f9dce11140fb581638a28cba62d0c0cfdc9 /gui.js | |
| parent | 37d82524f9c57d7d76ed56837ac0bda949f604d1 (diff) | |
| download | snap-f27e72e2b2005f96d680e12efb59aa146969d0ec.tar.gz snap-f27e72e2b2005f96d680e12efb59aa146969d0ec.zip | |
fixed #412 (incomplete sprite-removal)
Diffstat (limited to 'gui.js')
| -rw-r--r-- | gui.js | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -69,7 +69,7 @@ SpeechBubbleMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.gui = '2014-July-08'; +modules.gui = '2014-July-11'; // Declarations @@ -1833,23 +1833,23 @@ IDE_Morph.prototype.duplicateSprite = function (sprite) { IDE_Morph.prototype.removeSprite = function (sprite) { var idx = this.sprites.asArray().indexOf(sprite) + 1; - + this.stage.threads.stopAllForReceiver(sprite); sprite.destroy(); this.stage.watchers().forEach(function (watcher) { if (watcher.object() === sprite) { watcher.destroy(); } }); - - if (idx < 1) {return; } - + if (idx > 0) { + this.sprites.remove(idx); + } + this.createCorral(); + this.fixLayout(); this.currentSprite = detect( this.stage.children, function (morph) {return morph instanceof SpriteMorph; } ) || this.stage; - this.sprites.remove(this.sprites.asArray().indexOf(sprite) + 1); - this.createCorral(); - this.fixLayout(); + this.selectSprite(this.currentSprite); }; |
