Speed up unhiding of workspace with large numbers of blocks.

This commit is contained in:
Neil Fraser
2015-10-24 23:51:27 -04:00
parent 2f30034983
commit ec99c95718

View File

@@ -380,11 +380,11 @@ Blockly.WorkspaceSvg.prototype.setVisible = function(isVisible) {
* Render all blocks in workspace.
*/
Blockly.WorkspaceSvg.prototype.render = function() {
var renderList = this.getAllBlocks();
for (var i = 0, block; block = renderList[i]; i++) {
if (!block.getChildren().length) {
block.render();
}
// Generate list of all blocks.
var blocks = this.getAllBlocks();
// Render each block.
for (var i = blocks.length - 1; i >= 0; i--) {
blocks[i].render(false);
}
};