From 8ef540a8dccc48a78003a104a931baa80c175cff Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Tue, 30 Jul 2019 10:50:59 -0700 Subject: [PATCH] Used moveBy in moveTo (#2741) --- core/block_svg.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/core/block_svg.js b/core/block_svg.js index 4d9032e5f..cbb9891e7 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -396,21 +396,8 @@ Blockly.BlockSvg.prototype.moveToDragSurface_ = function() { * @param {Blockly.utils.Coordinate} xy The position to move to in workspace units. */ Blockly.BlockSvg.prototype.moveTo = function(xy) { - if (this.parentBlock_) { - throw Error('Block has parent.'); - } - var eventsEnabled = Blockly.Events.isEnabled(); - if (eventsEnabled) { - var event = new Blockly.Events.BlockMove(this); - } var curXY = this.getRelativeToSurfaceXY(); - this.translate(xy.x, xy.y); - this.moveConnections_(xy.x - curXY.x, xy.y - curXY.y); - if (eventsEnabled) { - event.recordNew(); - Blockly.Events.fire(event); - } - this.workspace.resizeContents(); + this.moveBy(xy.x - curXY.x, xy.y - curXY.y); }; /**