Fix bug in zelos tight nesting code. (#3565)

This commit is contained in:
Sam El-Husseini
2020-01-08 08:47:10 -08:00
committed by GitHub
parent 26db9167db
commit e530f209cd
2 changed files with 4 additions and 2 deletions

View File

@@ -104,8 +104,7 @@ Blockly.zelos.Drawer.prototype.drawRightSideRow_ = function(row) {
if (row.precedesStatement || row.followsStatement) {
var cornerHeight = this.constants_.INSIDE_CORNERS.rightHeight;
var remainingHeight = row.height -
(row.precedesStatement ? cornerHeight : 0) -
(row.followsStatement ? cornerHeight : 0);
(row.precedesStatement ? cornerHeight : 0);
this.outlinePath_ +=
(row.followsStatement ?
this.constants_.INSIDE_CORNERS.pathBottomRight : '') +

View File

@@ -505,12 +505,15 @@ Blockly.zelos.RenderInfo.prototype.finalizeVerticalAlignment_ = function() {
elem.connectedBlock.getHeightWidth().height >=
MIN_VERTICAL_TIGHTNESTING_HEIGHT) {
hasNonShadowConnectedBlocks = true;
hasSingleTextOrImageField = false;
break;
} else if (Blockly.blockRendering.Types.isField(elem) &&
(elem.field instanceof Blockly.FieldLabel ||
elem.field instanceof Blockly.FieldImage)) {
hasSingleTextOrImageField =
hasSingleTextOrImageField == null ? true : false;
} else if (!Blockly.blockRendering.Types.isSpacer(elem)) {
hasSingleTextOrImageField = false;
}
}
// Reduce the previous and next spacer's height.