kopia lustrzana https://github.com/backface/turtlestitch
fix cache clearing for primitive hiding
rodzic
27c116bee4
commit
2a061f57f3
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Ładowanie…
Reference in New Issue