Add margin only for buttons, not labels (#1322)

This commit is contained in:
Eric Rosenbaum
2017-09-19 13:46:49 -04:00
committed by Rachel Fenichel
parent c5be6e1722
commit d0e1141a9f

View File

@@ -155,11 +155,11 @@ Blockly.FlyoutButton.prototype.createDom = function() {
this.svgGroup_);
svgText.textContent = this.text_;
this.width = svgText.getComputedTextLength() +
2 * Blockly.FlyoutButton.MARGIN;
this.width = svgText.getComputedTextLength();
this.height = 20; // Can't compute it :(
if (!this.isLabel_) {
this.width += 2 * Blockly.FlyoutButton.MARGIN;
shadow.setAttribute('width', this.width);
shadow.setAttribute('height', this.height);
}