Fix #3228 by only using the dark path offset in Geras.

This commit is contained in:
Rachel Fenichel
2019-10-21 17:21:44 -07:00
parent ff067497fc
commit d11b7228c2
3 changed files with 25 additions and 2 deletions

View File

@@ -309,7 +309,7 @@ Blockly.blockRendering.RenderInfo.prototype.populateBottomRow_ = function() {
if (followsStatement) {
this.bottomRow.minHeight = this.constants_.LARGE_PADDING;
} else {
this.bottomRow.minHeight = this.constants_.MEDIUM_PADDING - 1;
this.bottomRow.minHeight = this.constants_.MEDIUM_PADDING;
}
var leftSquareCorner = this.bottomRow.hasLeftSquareCorner(this.block_);

View File

@@ -73,6 +73,28 @@ Blockly.geras.RenderInfo.prototype.getRenderer = function() {
return /** @type {!Blockly.geras.Renderer} */ (this.renderer_);
};
/**
* @override
*/
Blockly.geras.RenderInfo.prototype.populateBottomRow_ = function() {
Blockly.geras.RenderInfo.superClass_.populateBottomRow_.call(this);
var followsStatement =
this.block_.inputList.length &&
this.block_.inputList[this.block_.inputList.length - 1]
.type == Blockly.NEXT_STATEMENT;
// The minimum height of the bottom row is smaller in Geras than in other
// renderers, because the dark path adds a pixel.
// If one of the row's elements has a greater height this will be overwritten
// in the compute pass.
if (!followsStatement) {
this.bottomRow.minHeight =
this.constants_.MEDIUM_PADDING - this.constants_.DARK_PATH_OFFSET;
}
};
/**
* @override
*/

View File

@@ -154,7 +154,8 @@ Blockly.blockRendering.ExternalValueInput = function(constants, input) {
this.height = this.shape.height;
} else {
this.height =
this.connectedBlockHeight - 2 * this.constants_.TAB_OFFSET_FROM_TOP;
this.connectedBlockHeight - this.constants_.TAB_OFFSET_FROM_TOP -
this.constants_.MEDIUM_PADDING;
}
this.width = this.shape.width +
this.constants_.EXTERNAL_VALUE_INPUT_PADDING;