diff --git a/core/renderers/common/info.js b/core/renderers/common/info.js index 9a35bcb70..460cee391 100644 --- a/core/renderers/common/info.js +++ b/core/renderers/common/info.js @@ -754,6 +754,13 @@ Blockly.blockRendering.RenderInfo.prototype.finalize_ = function() { Math.max(widestRowWithConnectedBlocks, row.widthWithConnectedBlocks); this.recordElemPositions_(row); } + if (this.outputConnection && this.block_.nextConnection && + this.block_.nextConnection.isConnected()) { + // Include width of connected block in value to stack width measurement. + widestRowWithConnectedBlocks = + Math.max(widestRowWithConnectedBlocks, + this.block_.nextConnection.targetBlock().getHeightWidth().width); + } this.widthWithChildren = Math.max(this.widthWithChildren, widestRowWithConnectedBlocks + this.startX); diff --git a/core/renderers/geras/info.js b/core/renderers/geras/info.js index f0b2dcb25..00b85b35f 100644 --- a/core/renderers/geras/info.js +++ b/core/renderers/geras/info.js @@ -403,6 +403,15 @@ Blockly.geras.RenderInfo.prototype.finalize_ = function() { } this.recordElemPositions_(row); } + if (this.outputConnection && this.block_.nextConnection && + this.block_.nextConnection.isConnected()) { + // Include width of connected block in value to stack width measurement. + widestRowWithConnectedBlocks = + Math.max(widestRowWithConnectedBlocks, + this.block_.nextConnection.targetBlock().getHeightWidth().width - + this.constants_.DARK_PATH_OFFSET); + } + this.bottomRow.baseline = yCursor - this.bottomRow.descenderHeight; // The dark (lowlight) adds to the size of the block in both x and y. diff --git a/core/renderers/thrasos/info.js b/core/renderers/thrasos/info.js index 6484d86ee..9589ef27f 100644 --- a/core/renderers/thrasos/info.js +++ b/core/renderers/thrasos/info.js @@ -329,6 +329,13 @@ Blockly.thrasos.RenderInfo.prototype.finalize_ = function() { } this.recordElemPositions_(row); } + if (this.outputConnection && this.block_.nextConnection && + this.block_.nextConnection.isConnected()) { + // Include width of connected block in value to stack width measurement. + widestRowWithConnectedBlocks = + Math.max(widestRowWithConnectedBlocks, + this.block_.nextConnection.targetBlock().getHeightWidth().width); + } this.bottomRow.baseline = yCursor - this.bottomRow.descenderHeight; this.widthWithChildren = widestRowWithConnectedBlocks + this.startX;