From 2a9ef4f0f0042d23f54beb72932bd5e3df739f80 Mon Sep 17 00:00:00 2001 From: hpnrep6 Date: Fri, 13 Aug 2021 20:32:26 -0400 Subject: [PATCH] fix: blocks with no next connections overlapping statement input in Zelos (#5369) * Use zelos' StatementInput function in addInput_ * Add align check to addInput_ --- core/renderers/zelos/info.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index b7dc3d972..3028af1ae 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -28,6 +28,7 @@ goog.require('Blockly.utils.object'); goog.require('Blockly.zelos.BottomRow'); goog.require('Blockly.zelos.RightConnectionShape'); goog.require('Blockly.zelos.TopRow'); +goog.require('Blockly.zelos.StatementInput'); goog.requireType('Blockly.BlockSvg'); goog.requireType('Blockly.zelos.ConstantProvider'); @@ -270,6 +271,16 @@ Blockly.zelos.RenderInfo.prototype.addInput_ = function(input, activeRow) { activeRow.align == Blockly.constants.ALIGN.LEFT && input.align == Blockly.constants.ALIGN.RIGHT) { activeRow.rightAlignedDummyInput = input; + } else if (input.type == Blockly.inputTypes.STATEMENT) { + // Handle statements without next connections correctly. + activeRow.elements.push( + new Blockly.zelos.StatementInput(this.constants_, input)); + activeRow.hasStatement = true; + + if (activeRow.align == null) { + activeRow.align = input.align; + } + return; } Blockly.zelos.RenderInfo.superClass_.addInput_.call(this, input, activeRow); };