Fix bug in base renderer, not respecting the bottom row's overhang Y property. (#2942)

This commit is contained in:
Sam El-Husseini
2019-08-30 15:44:44 -07:00
committed by GitHub
parent 4b4b14dbbc
commit 6050456bcf

View File

@@ -467,14 +467,20 @@ Blockly.blockRendering.RenderInfo.prototype.getSpacerRowHeight_ = function(
/**
* Calculate the centerline of an element in a rendered row.
* @param {Blockly.blockRendering.Row} row The row containing the element.
* @param {Blockly.blockRendering.Measurable} _elem The element to place.
* @param {Blockly.blockRendering.Measurable} elem The element to place.
* @return {number} The desired centerline of the given element, as an offset
* from the top left of the block.
* @protected
*/
Blockly.blockRendering.RenderInfo.prototype.getElemCenterline_ = function(row,
_elem) {
return row.yPos + row.height / 2;
elem) {
var result = row.yPos;
if (elem.isNextConnection()) {
result += (row.height - row.overhangY + elem.height / 2);
} else {
result += (row.height / 2);
}
return result;
};
/**