diff --git a/core/renderers/zelos/constants.js b/core/renderers/zelos/constants.js index d3c485286..57ad6b32a 100644 --- a/core/renderers/zelos/constants.js +++ b/core/renderers/zelos/constants.js @@ -109,7 +109,7 @@ Blockly.zelos.ConstantProvider = function() { /** * @override */ - this.TOP_ROW_MIN_HEIGHT = this.GRID_UNIT; + this.TOP_ROW_MIN_HEIGHT = this.CORNER_RADIUS; /** * @override @@ -119,7 +119,7 @@ Blockly.zelos.ConstantProvider = function() { /** * @override */ - this.BOTTOM_ROW_MIN_HEIGHT = this.GRID_UNIT; + this.BOTTOM_ROW_MIN_HEIGHT = this.CORNER_RADIUS; /** * @override diff --git a/core/renderers/zelos/info.js b/core/renderers/zelos/info.js index 90f606c6c..1ab34115e 100644 --- a/core/renderers/zelos/info.js +++ b/core/renderers/zelos/info.js @@ -212,21 +212,28 @@ Blockly.zelos.RenderInfo.prototype.getSpacerRowHeight_ = function( Blockly.blockRendering.Types.isInputRow(next) && next.hasStatement; if (precedesStatement || followsStatement) { var cornerHeight = this.constants_.INSIDE_CORNERS.rightHeight || 0; - var height = Math.max(this.constants_.MEDIUM_PADDING, - Math.max(this.constants_.NOTCH_HEIGHT, cornerHeight)); + var height = Math.max(this.constants_.NOTCH_HEIGHT, cornerHeight); return precedesStatement && followsStatement ? Math.max(height, this.constants_.DUMMY_INPUT_MIN_HEIGHT) : height; } // Top and bottom rows act as a spacer so we don't need any extra padding. if ((Blockly.blockRendering.Types.isTopRow(prev))) { - if (!prev.hasPreviousConnection && !this.outputConnection) { - return this.constants_.SMALL_PADDING; + if (!prev.hasPreviousConnection && + (!this.outputConnection || this.hasStatementInput)) { + return Math.abs(this.constants_.NOTCH_HEIGHT - + this.constants_.CORNER_RADIUS); } return this.constants_.NO_PADDING; } if ((Blockly.blockRendering.Types.isBottomRow(next))) { if (!this.outputConnection) { - return this.constants_.SMALL_PADDING; + var topHeight = Math.max(this.topRow.minHeight, + Math.max(this.constants_.NOTCH_HEIGHT, + this.constants_.CORNER_RADIUS)) - this.constants_.CORNER_RADIUS; + return topHeight; + } else if (!next.hasNextConnection && this.hasStatementInput) { + return Math.abs(this.constants_.NOTCH_HEIGHT - + this.constants_.CORNER_RADIUS); } return this.constants_.NO_PADDING; }