Fix #967 by overriding the updateWidth method in FieldImage blocks to be a no-op. FieldImage fields should not change size after the width is set in init. The updateWidth and, therefore, getCachedWidth is now being called by BlockSvg renderFields_ (see commit d55d9cbd9f). IIUC, updateWidth/getCachedWidth was only called from render before which is overridden in FieldImage to be a no-op already. (#979)

This commit is contained in:
picklesrus
2017-03-17 16:15:40 -07:00
committed by GitHub
parent 036f364e57
commit fd7d8b1ac8

View File

@@ -153,3 +153,10 @@ Blockly.FieldImage.prototype.setText = function(alt) {
Blockly.FieldImage.prototype.render_ = function() {
// NOP
};
/**
* Images are fixed width, no need to update.
* @private
*/
Blockly.FieldImage.prototype.updateWidth = function() {
// NOP
};