Merge pull request #2833 from rachel-fenichel/remove_render_icon

Remove renderIcon function
This commit is contained in:
Rachel Fenichel
2019-08-15 11:28:21 -07:00
committed by GitHub
2 changed files with 0 additions and 34 deletions

View File

@@ -67,11 +67,6 @@ Blockly.BlockSvg.PathObject = function() {
};
// UI constants for rendering blocks.
/**
* Horizontal space between elements.
* @const
*/
Blockly.BlockSvg.SEP_SPACE_X = 10;
/**
* Vertical space between elements.
* @const

View File

@@ -142,35 +142,6 @@ Blockly.Icon.prototype.updateColour = function() {
}
};
/**
* Render the icon.
* @param {number} cursorX Horizontal offset at which to position the icon.
* @return {number} Horizontal offset for next item to draw.
*/
Blockly.Icon.prototype.renderIcon = function(cursorX) {
if ((this.collapseHidden && this.block_.isCollapsed()) ||
this.block_.isInsertionMarker()) {
this.iconGroup_.setAttribute('display', 'none');
return cursorX;
}
this.iconGroup_.setAttribute('display', 'block');
var TOP_MARGIN = 5;
var width = this.SIZE;
if (this.block_.RTL) {
cursorX -= width;
}
this.iconGroup_.setAttribute('transform',
'translate(' + cursorX + ',' + TOP_MARGIN + ')');
this.computeIconLocation();
if (this.block_.RTL) {
cursorX -= Blockly.BlockSvg.SEP_SPACE_X;
} else {
cursorX += width + Blockly.BlockSvg.SEP_SPACE_X;
}
return cursorX;
};
/**
* Notification that the icon has moved. Update the arrow accordingly.
* @param {!Blockly.utils.Coordinate} xy Absolute location in workspace coordinates.