Make insertion markers for define blocks have the correct width ()

* Fix 

* Added comment to clarify which case is being handled
This commit is contained in:
Erik Mejer Hansen 2018-11-13 15:49:37 +01:00 committed by picklesrus
parent 1465a9efe2
commit 88091d21df

View file

@ -1606,7 +1606,9 @@ Blockly.BlockSvg.prototype.renderDefineBlock_ = function(steps, inputRows,
input.connection.targetBlock().getHeightWidth().width +
Blockly.BlockSvg.DEFINE_BLOCK_PADDING_RIGHT;
} else {
rightSide = Blockly.BlockSvg.MIN_BLOCK_X_WITH_STATEMENT;
// Handles the case where block is being rendered as an insertion marker
rightSide = Math.max(Blockly.BlockSvg.MIN_BLOCK_X_WITH_STATEMENT, rightSide)
+ Blockly.BlockSvg.DEFINE_BLOCK_PADDING_RIGHT;
}
rightSide -= Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS;