mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Simplify statement input height computation logic.
This commit is contained in:
@@ -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};
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user