Improve rendering of flyouts with many blocks

This commit is contained in:
Evan W. Patton
2017-05-15 18:08:26 -04:00
parent 824b2cae18
commit fe8ec09de6

View File

@@ -758,6 +758,7 @@ Blockly.Flyout.prototype.show = function(xmlList) {
}
this.setVisible(true);
this.workspace_.rendered = false;
// Create the blocks to be shown in this flyout.
var contents = [];
var gaps = [];
@@ -800,6 +801,12 @@ Blockly.Flyout.prototype.show = function(xmlList) {
}
}
}
this.workspace_.rendered = true;
var blocks = goog.object.getValues(this.workspace_.blockDB_);
for (var i = 0; i < blocks.length; i++) {
blocks[i].initSvg();
}
this.workspace_.render();
this.layout_(contents, gaps);