[zelos] Statement input centreline (#3513)

* Make statement inputs in zelos use the top row centreline.
This commit is contained in:
Sam El-Husseini
2019-12-15 02:34:58 -08:00
committed by GitHub
parent c892496668
commit 38e2b9d3ca
2 changed files with 16 additions and 0 deletions

View File

@@ -96,6 +96,11 @@ Blockly.zelos.ConstantProvider = function() {
*/
this.MIN_BLOCK_HEIGHT = 12 * this.GRID_UNIT;
/**
* @override
*/
this.EMPTY_STATEMENT_INPUT_HEIGHT = 6 * this.GRID_UNIT;
/**
* @override
*/

View File

@@ -221,6 +221,17 @@ Blockly.zelos.RenderInfo.prototype.getSpacerRowWidth_ = function(prev, next) {
return width;
};
/**
* @override
*/
Blockly.zelos.RenderInfo.prototype.getElemCenterline_ = function(row, elem) {
if (row.hasStatement) {
return row.yPos + this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT / 2;
}
return Blockly.zelos.RenderInfo.superClass_.getElemCenterline_.call(this,
row, elem);
};
/**
* Adjust the x position of fields to bump all non-label fields in the first row
* past the notch position. This must be called before ``computeBounds`` is