Simplify statement input height computation logic.

This commit is contained in:
kozbial
2019-08-27 15:59:23 -07:00
parent 0251340a65
commit e063ae5a38
3 changed files with 1 additions and 7 deletions

View File

@@ -104,9 +104,6 @@ Blockly.BlockSvg.prototype.getHeightWidth = function() {
var nextHeightWidth = nextBlock.getHeightWidth();
height += nextHeightWidth.height - 4; // Height of tab.
width = Math.max(width, nextHeightWidth.width);
} else if (!this.nextConnection && !this.outputConnection) {
// Add a bit of margin under blocks with no bottom tab.
height += 2;
}
return {height: height, width: width};
};

View File

@@ -77,7 +77,7 @@ Blockly.blockRendering.ConstantProvider = function() {
// the left side of the notch.
this.NOTCH_OFFSET_LEFT = 15;
this.STATEMENT_BOTTOM_SPACER = 5;
this.STATEMENT_BOTTOM_SPACER = 0;
this.STATEMENT_INPUT_PADDING_LEFT = 20;
this.BETWEEN_STATEMENT_PADDING_Y = 4;

View File

@@ -120,9 +120,6 @@ Blockly.blockRendering.StatementInput = function(input) {
} else {
this.height =
this.connectedBlockHeight + this.constants_.STATEMENT_BOTTOM_SPACER;
if (this.connectedBlock.nextConnection) {
this.height -= this.shape.height;
}
}
this.width = this.constants_.NOTCH_OFFSET_LEFT +
this.shape.width;