mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
[zelos] Statement input centreline (#3513)
* Make statement inputs in zelos use the top row centreline.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user