fixed #412 (incomplete sprite-removal)

pull/3/merge
jmoenig 2014-07-11 17:14:35 +02:00
rodzic 37d82524f9
commit f27e72e2b2
2 zmienionych plików z 9 dodań i 8 usunięć

16
gui.js
Wyświetl plik

@ -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);
};

Wyświetl plik

@ -2194,3 +2194,4 @@ ______
* Morphic: allow directly editing properties in inspector widgets
* Blocks: change the color of the %pause symbol to be more yellowish
* Threads: fixed #506, thanks @haritop, for both the report and for providing the fix!!
* GUI: fixed #412 (incomplete sprite-removal)