Adjust zelos spacing constants (#3487)

This commit is contained in:
Sam El-Husseini
2019-12-05 11:20:51 -08:00
committed by GitHub
parent 10b3a9aa9a
commit bcb9e949d2
2 changed files with 12 additions and 1 deletions

View File

@@ -81,6 +81,11 @@ Blockly.zelos.ConstantProvider = function() {
*/
this.NOTCH_OFFSET_LEFT = 3 * this.GRID_UNIT;
/**
* @override
*/
this.MIN_BLOCK_WIDTH = 2 * this.GRID_UNIT;
/**
* @override
*/
@@ -115,7 +120,7 @@ Blockly.zelos.ConstantProvider = function() {
* Minimum statement input spacer width.
* @type {number}
*/
this.STATEMENT_INPUT_SPACER_MIN_WIDTH = 34.5 * this.GRID_UNIT;
this.STATEMENT_INPUT_SPACER_MIN_WIDTH = 40 * this.GRID_UNIT;
/**
* @override

View File

@@ -191,9 +191,15 @@ Blockly.zelos.RenderInfo.prototype.getSpacerRowHeight_ = function(
}
// 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;
}
return this.constants_.NO_PADDING;
}
if ((Blockly.blockRendering.Types.isBottomRow(next))) {
if (!this.outputConnection) {
return this.constants_.SMALL_PADDING;
}
return this.constants_.NO_PADDING;
}
return this.constants_.MEDIUM_PADDING;