fix cache clearing for primitive hiding

snap7
Michael Ball 2021-06-29 20:41:22 -07:00
rodzic 27c116bee4
commit 2a061f57f3
2 zmienionych plików z 16 dodań i 3 usunięć

Wyświetl plik

@ -3237,11 +3237,22 @@ BlockMorph.prototype.developersMenu = function () {
return menu;
};
BlockMorph.prototype.hidePrimitive = function () {
var ide = this.parentThatIsA(IDE_Morph);
BlockMorph.prototype.hidePrimitive = function (args) {
var ide = this.parentThatIsA(IDE_Morph),
dict,
cat;
if (!ide) {return; }
StageMorph.prototype.hiddenPrimitives[this.selector] = true;
ide.flushBlocksCache(ide.currentCategory);
dict = {
doWarp: 'control',
reifyScript: 'operators',
reifyReporter: 'operators',
reifyPredicate: 'operators',
doDeclareVariables: 'variables'
};
cat = dict[this.selector] || this.category;
if (cat === 'lists') {cat = 'variables'; }
ide.flushBlocksCache(cat);
ide.refreshPalette();
};

Wyświetl plik

@ -5791,9 +5791,11 @@ IDE_Morph.prototype.flushPaletteCache = function (category) {
// if no category is specified, the whole cache gets flushed
if (category) {
this.stage.paletteCache[category] = null;
this.stage.paletteCache.unified = null;
this.stage.children.forEach(m => {
if (m instanceof SpriteMorph) {
m.paletteCache[category] = null;
m.paletteCache.unified = null;
}
});
} else {