diff --git a/core/block_render_svg.js b/core/block_render_svg.js index 328f4d849..017bc3402 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -554,10 +554,13 @@ Blockly.BlockSvg.prototype.renderDraw_ = function(iconWidth, inputRows) { */ Blockly.BlockSvg.prototype.renderMoveConnections_ = function() { var blockTL = this.getRelativeToSurfaceXY(); + // Don't tighten previous or output connecitons because they are inferior + // connections. if (this.previousConnection) { this.previousConnection.moveToOffset(blockTL); - // Don't tighten the previous connection because it's an inferior - // connection. + } + if (this.outputConnection) { + this.outputConnection.moveToOffset(blockTL); } for (var i = 0; i < this.inputList.length; i++) { @@ -577,10 +580,6 @@ Blockly.BlockSvg.prototype.renderMoveConnections_ = function() { } } - if (this.outputConnection) { - this.outputConnection.moveToOffset(blockTL); - // Don't tighten the output connection because it's an inferior connection. - } }; /** @@ -774,8 +773,8 @@ Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps, highlightSteps, ',-2.1'); } // Create external input connection. - connectionX = (this.RTL ? -inputRows.rightEdge - 1 : - inputRows.rightEdge + 1); + connectionX = this.RTL ? -inputRows.rightEdge - 1 : + inputRows.rightEdge + 1; input.connection.setOffsetInBlock(connectionX, cursorY); if (input.connection.isConnected()) { this.width = Math.max(this.width, inputRows.rightEdge + @@ -855,9 +854,9 @@ Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps, highlightSteps, highlightSteps.push('H', inputRows.rightEdge - 0.5); } // Create statement connection. - connectionX = (this.RTL ? -cursorX : cursorX + 1); - + connectionX = this.RTL ? -cursorX : cursorX + 1; input.connection.setOffsetInBlock(connectionX, cursorY + 1); + if (input.connection.isConnected()) { this.width = Math.max(this.width, inputRows.statementEdge + input.connection.targetBlock().getHeightWidth().width); diff --git a/core/rendered_connection.js b/core/rendered_connection.js index 29f6fc19e..20186b098 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -127,7 +127,7 @@ Blockly.RenderedConnection.prototype.moveBy = function(dx, dy) { /** * Move this connection to the location given by its offset within the block and * the coordinate of the block's top left corner. - * @param {goog.math.Coordinate} blockTL The coordinate of the top left corner + * @param {!goog.math.Coordinate} blockTL The coordinate of the top left corner * of the block. */ Blockly.RenderedConnection.prototype.moveToOffset = function(blockTL) {