Remove duplicated connection path from connection.js

This commit is contained in:
Neil Fraser
2016-01-28 22:12:42 -05:00
parent 211595075e
commit a114849545

View File

@@ -435,14 +435,10 @@ Blockly.Connection.prototype.highlight = function() {
if (this.type == Blockly.INPUT_VALUE || this.type == Blockly.OUTPUT_VALUE) {
var tabWidth = this.sourceBlock_.RTL ? -Blockly.BlockSvg.TAB_WIDTH :
Blockly.BlockSvg.TAB_WIDTH;
steps = 'm 0,0 v 5 c 0,10 ' + -tabWidth + ',-8 ' + -tabWidth + ',7.5 s ' +
tabWidth + ',-2.5 ' + tabWidth + ',7.5 v 5';
steps = 'm 0,0 ' + Blockly.BlockSvg.TAB_PATH_DOWN + ' v 5';
} else {
if (this.sourceBlock_.RTL) {
steps = 'm 20,0 h -5 ' + Blockly.BlockSvg.NOTCH_PATH_RIGHT + ' h -5';
} else {
steps = 'm -20,0 h 5 ' + Blockly.BlockSvg.NOTCH_PATH_LEFT + ' h 5';
}
steps = 'm -20,0 h 5 ' + Blockly.BlockSvg.NOTCH_PATH_LEFT + ' h 5';
}
var xy = this.sourceBlock_.getRelativeToSurfaceXY();
var x = this.x_ - xy.x;
@@ -450,7 +446,8 @@ Blockly.Connection.prototype.highlight = function() {
Blockly.Connection.highlightedPath_ = Blockly.createSvgElement('path',
{'class': 'blocklyHighlightedConnectionPath',
'd': steps,
transform: 'translate(' + x + ',' + y + ')'},
transform: 'translate(' + x + ',' + y + ')' +
(this.sourceBlock_.RTL ? ' scale(-1 1)' : '')},
this.sourceBlock_.getSvgRoot());
};