mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Block rendering performance (#1363)
* Use Blockly.Field.getCachedWidth instead of non-caching method * Check for timeout pid before calling clearTimeout
This commit is contained in:
committed by
Rachel Fenichel
parent
82705923cb
commit
075bda45a5
@@ -155,7 +155,7 @@ Blockly.FlyoutButton.prototype.createDom = function() {
|
||||
this.svgGroup_);
|
||||
svgText.textContent = this.text_;
|
||||
|
||||
this.width = svgText.getComputedTextLength();
|
||||
this.width = Blockly.Field.getCachedWidth(svgText);
|
||||
this.height = 20; // Can't compute it :(
|
||||
|
||||
if (!this.isLabel_) {
|
||||
|
||||
@@ -248,7 +248,9 @@ Blockly.Tooltip.hide = function() {
|
||||
Blockly.Tooltip.DIV.style.display = 'none';
|
||||
}
|
||||
}
|
||||
clearTimeout(Blockly.Tooltip.showPid_);
|
||||
if (Blockly.Tooltip.showPid_) {
|
||||
clearTimeout(Blockly.Tooltip.showPid_);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user