mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Adjust what the spacers at after the top and before the bottom rows depend on. Make them depend on the top row's minHeight and desired height. (#3686)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user