fix: blocks with no next connections overlapping statement input in Zelos (#5369)

* Use zelos' StatementInput function in addInput_

* Add align check to addInput_
This commit is contained in:
hpnrep6
2021-08-13 20:32:26 -04:00
committed by GitHub
parent 50e470ccb1
commit 2a9ef4f0f0

View File

@@ -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);
};