From dc709c2e1282e2056d74d3a9ba77e21b50d463f4 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 30 Sep 2013 14:41:59 +0200 Subject: fixed #186 (can't duplicate blocks with anchored comments) --- blocks.js | 15 +++++++-------- history.txt | 4 ++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/blocks.js b/blocks.js index 4e85416..20e1e47 100644 --- a/blocks.js +++ b/blocks.js @@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2013-August-02'; +modules.blocks = '2013-September-30'; var SyntaxElementMorph; var BlockMorph; @@ -2910,10 +2910,10 @@ BlockMorph.prototype.situation = function () { // BlockMorph sticky comments -BlockMorph.prototype.prepareToBeGrabbed = function () { +BlockMorph.prototype.prepareToBeGrabbed = function (hand) { var myself = this; this.allComments().forEach(function (comment) { - comment.startFollowing(myself); + comment.startFollowing(myself, hand.world); }); }; @@ -10133,7 +10133,7 @@ CommentMorph.prototype.userMenu = function () { menu.addItem( "duplicate", function () { - this.fullCopy().pickUp(this.world()); + myself.fullCopy().pickUp(myself.world()); }, 'make a copy\nand pick it up' ); @@ -10252,14 +10252,13 @@ CommentMorph.prototype.align = function (topBlock, ignoreLayer) { } }; -CommentMorph.prototype.startFollowing = function (topBlock) { - var myself = this; +CommentMorph.prototype.startFollowing = function (topBlock, world) { this.align(topBlock); - this.world().add(this); + world.add(this); this.addShadow(); this.stickyOffset = this.position().subtract(this.block.position()); this.step = function () { - myself.setPosition(this.block.position().add(myself.stickyOffset)); + this.setPosition(this.block.position().add(this.stickyOffset)); }; }; diff --git a/history.txt b/history.txt index 1134bd5..446505f 100755 --- a/history.txt +++ b/history.txt @@ -1925,3 +1925,7 @@ ______ 130920 ------ * Morphic: fixed #172, Rectangle.amountToTranslateWithin() for IF ON EDGE, BOUNCE + +130930 +------ +* Blocks: fixed #186 (can't duplicate blocks with anchored comments) -- cgit v1.3.1