From 99c970bcf56ac262bf063ced42d6f3c32fd9eacb Mon Sep 17 00:00:00 2001 From: kozbial Date: Tue, 13 Aug 2019 13:25:35 -0700 Subject: [PATCH] Adding missing padding to statement input rows. --- .../block_rendering_rewrite/block_render_info.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/renderers/block_rendering_rewrite/block_render_info.js b/core/renderers/block_rendering_rewrite/block_render_info.js index 1262e6639..9821dec28 100644 --- a/core/renderers/block_rendering_rewrite/block_render_info.js +++ b/core/renderers/block_rendering_rewrite/block_render_info.js @@ -536,9 +536,14 @@ Blockly.blockRendering.RenderInfo.prototype.computeBounds_ = function() { Blockly.blockRendering.RenderInfo.prototype.alignRowElements_ = function() { for (var r = 0; r < this.rows.length; r++) { var row = this.rows[r]; - if (!row.hasStatement && !row.hasInlineInput) { + if (!row.hasInlineInput) { var currentWidth = row.width; - var desiredWidth = this.width - this.startX; + if (row.hasStatement) { + var statementInput = row.getLastInput(); + currentWidth -= statementInput.width; + } + var desiredWidth = row.hasStatement ? this.statementEdge : this.width; + desiredWidth -= this.startX; if (row.type === 'bottom row' && row.hasFixedWidth) { desiredWidth = Blockly.blockRendering.constants.MAX_BOTTOM_WIDTH; } @@ -564,7 +569,7 @@ Blockly.blockRendering.RenderInfo.prototype.addAlignmentPadding_ = function(row, if (input) { var firstSpacer = row.getFirstSpacer(); var lastSpacer = row.getLastSpacer(); - if (row.hasExternalInput) { + if (row.hasExternalInput || row.hasStatement) { // Get the spacer right before the input socket. lastSpacer = elems[elems.length - 3]; }