From ec99c957186d0c28c009aedb5702cafe0b16c14f Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Sat, 24 Oct 2015 23:51:27 -0400 Subject: [PATCH] Speed up unhiding of workspace with large numbers of blocks. --- core/workspace_svg.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 9c0f004bd..34157ce15 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -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); } };