kopia lustrzana https://github.com/backface/turtlestitch
grab duplicated blocks by their top left corner
thanks, @brianharvey for this suggestion!pull/95/head
rodzic
dff57e0ec5
commit
92ec41de4f
|
@ -148,7 +148,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.blocks = '2020-April-29';
|
||||
modules.blocks = '2020-May-01';
|
||||
|
||||
var SyntaxElementMorph;
|
||||
var BlockMorph;
|
||||
|
@ -4271,6 +4271,14 @@ BlockMorph.prototype.hasBlockVars = function () {
|
|||
);
|
||||
};
|
||||
|
||||
BlockMorph.prototype.pickUp = function (wrrld) {
|
||||
// used when duplicating and grabbing a block via its context menu
|
||||
// position the duplicate's top-left corner at the mouse pointer
|
||||
var world = wrrld || this.world();
|
||||
this.setPosition(world.hand.position().subtract(this.rounding));
|
||||
world.hand.grab(this);
|
||||
};
|
||||
|
||||
// BlockMorph events
|
||||
|
||||
BlockMorph.prototype.mouseClickLeft = function () {
|
||||
|
|
Ładowanie…
Reference in New Issue