Skip to content

Commit

Permalink
Make insertion markers for define blocks have the correct width (scra…
Browse files Browse the repository at this point in the history
…tchfoundation#1781)

* Fix scratchfoundation#1186

* Added comment to clarify which case is being handled
  • Loading branch information
ErikMejerHansen authored and picklesrus committed Nov 13, 2018
1 parent 1465a9e commit 88091d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/block_render_svg_vertical.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 88091d2

Please sign in to comment.