avoid creating "obsolete" blocks by not copying method blocks into
sprites that don't understand them
upd4.2
Jens Mönig 2017-11-26 13:21:28 +01:00
rodzic 94d8beb741
commit 266679d29c
2 zmienionych plików z 18 dodań i 10 usunięć

24
gui.js
Wyświetl plik

@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2017-November-16';
modules.gui = '2017-November-26';
// Declarations
@ -7203,22 +7203,26 @@ SpriteIconMorph.prototype.reactToDropOf = function (morph, hand) {
};
SpriteIconMorph.prototype.copyStack = function (block) {
var dup = block.fullCopy(),
y = Math.max(this.object.scripts.children.map(function (stack) {
var sprite = this.object,
dup = block.fullCopy(),
y = Math.max(sprite.scripts.children.map(function (stack) {
return stack.fullBounds().bottom();
}).concat([this.object.scripts.top()]));
}).concat([sprite.scripts.top()]));
dup.setPosition(new Point(this.object.scripts.left() + 20, y + 20));
this.object.scripts.add(dup);
dup.setPosition(new Point(sprite.scripts.left() + 20, y + 20));
sprite.scripts.add(dup);
dup.allComments().forEach(function (comment) {
comment.align(dup);
});
this.object.scripts.adjustBounds();
sprite.scripts.adjustBounds();
// delete all custom blocks pointing to local definitions
// under construction...
// delete all local custom blocks (methods) that the receiver
// doesn't understand
dup.allChildren().forEach(function (morph) {
if (morph.definition && !morph.definition.isGlobal) {
if (morph.isCustomBlock &&
!morph.isGlobal &&
!sprite.getMethod(morph.blockSpec)
) {
morph.deleteBlock();
}
});

Wyświetl plik

@ -3802,3 +3802,7 @@ Fixes:
* Blocks: avoid coloring the block-highlight when re-coloring a syntax element, this prevents highlighted blocks inside LAUNCH statements to expand when repeatedly single-stepped.
=== v4.1.0.4 maintenance release ===
171126
------
* GUI: fixed #1933 - avoid creating "obsolete" blocks by not copying method blocks into sprites that don't understand them