Treat a statement input as the end of the statement row. (#3577)

* Reduce spacing for editable fields when they appear right before a statement input.
This commit is contained in:
Sam El-Husseini
2020-01-11 17:34:45 -08:00
committed by GitHub
parent e1472a3600
commit 1924b2674a

View File

@@ -185,8 +185,9 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) {
return this.constants_.LARGE_PADDING;
}
// Spacing between a non-input and the end of the row.
if (!Blockly.blockRendering.Types.isInput(prev) && !next) {
// Spacing between a non-input and the end of the row or a statement input.
if (!Blockly.blockRendering.Types.isInput(prev) && (!next ||
Blockly.blockRendering.Types.isStatementInput(next))) {
// Between an editable field and the end of the row.
if (Blockly.blockRendering.Types.isField(prev) && prev.isEditable) {
return this.constants_.MEDIUM_PADDING;