mirror of
https://github.com/google/blockly.git
synced 2026-03-09 23:00:10 +01:00
[zelos] Limit vertical tightnesting (#3504)
* Limit vertical tight nesting to blocks with a certain height * Use const.
This commit is contained in:
@@ -398,9 +398,12 @@ Blockly.zelos.RenderInfo.prototype.finalizeVerticalAlignment_ = function() {
|
||||
if (Blockly.blockRendering.Types.isInputRow(row)) {
|
||||
// Determine if the input row has non-shadow connected blocks.
|
||||
var hasNonShadowConnectedBlocks = false;
|
||||
var MIN_VERTICAL_TIGHTNESTING_HEIGHT = 40;
|
||||
for (var j = 0, elem; (elem = row.elements[j]); j++) {
|
||||
if (Blockly.blockRendering.Types.isInlineInput(elem) &&
|
||||
elem.connectedBlock && !elem.connectedBlock.isShadow()) {
|
||||
elem.connectedBlock && !elem.connectedBlock.isShadow() &&
|
||||
elem.connectedBlock.getHeightWidth().height >=
|
||||
MIN_VERTICAL_TIGHTNESTING_HEIGHT) {
|
||||
hasNonShadowConnectedBlocks = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,12 @@ Blockly.zelos.PathObject.prototype.applyColour = function(block) {
|
||||
if (block.isShadow() && block.getParent()) {
|
||||
this.svgPath.setAttribute('stroke', block.getParent().style.colourTertiary);
|
||||
}
|
||||
|
||||
// Apply colour to outlines.
|
||||
for (var i = 0, keys = Object.keys(this.outlines_),
|
||||
key; (key = keys[i]); i++) {
|
||||
this.outlines_[key].setAttribute('fill', this.style.colourTertiary);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user