Using shapeFor to determine connections shape for marker_svg. (#3573)

This commit is contained in:
Monica Kozbial
2020-01-10 13:32:44 -08:00
committed by GitHub
parent 9b8fa7a177
commit c2087e61f5

View File

@@ -235,7 +235,7 @@ Blockly.blockRendering.MarkerSvg.prototype.showWithField_ = function(curNode) {
* @protected
*/
Blockly.blockRendering.MarkerSvg.prototype.showWithInput_ = function(curNode) {
var connection = /** @type {Blockly.Connection} */
var connection = /** @type {Blockly.RenderedConnection} */
(curNode.getLocation());
var sourceBlock = /** @type {!Blockly.BlockSvg} */ (connection.getSourceBlock());
@@ -333,7 +333,7 @@ Blockly.blockRendering.MarkerSvg.prototype.positionBlock_ = function(
/**
* Position the marker for an input connection.
* Displays a filled in puzzle piece.
* @param {!Blockly.Connection} connection The connection to position marker around.
* @param {!Blockly.RenderedConnection} connection The connection to position marker around.
* @private
*/
Blockly.blockRendering.MarkerSvg.prototype.positionInput_ = function(connection) {
@@ -341,7 +341,7 @@ Blockly.blockRendering.MarkerSvg.prototype.positionInput_ = function(connection)
var y = connection.getOffsetInBlock().y;
var path = Blockly.utils.svgPaths.moveTo(0, 0) +
this.constants_.PUZZLE_TAB.pathDown;
this.constants_.shapeFor(connection).pathDown;
this.markerInput_.setAttribute('d', path);
this.markerInput_.setAttribute('transform',