mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Merge pull request #2833 from rachel-fenichel/remove_render_icon
Remove renderIcon function
This commit is contained in:
@@ -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
|
||||
|
||||
29
core/icon.js
29
core/icon.js
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user