more watcher and result bubble migrations

pull/95/head
jmoenig 2020-03-16 16:59:38 +01:00
rodzic 044101260b
commit 26e9e689a5
2 zmienionych plików z 37 dodań i 27 usunięć

Wyświetl plik

@ -148,7 +148,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2020-March-10'; modules.blocks = '2020-March-16';
var SyntaxElementMorph; var SyntaxElementMorph;
var BlockMorph; var BlockMorph;
@ -2138,14 +2138,15 @@ SyntaxElementMorph.prototype.showBubble = function (value, exportPic, target) {
if (isSnapObject(value)) { if (isSnapObject(value)) {
img = value.thumbnail(new Point(40, 40)); img = value.thumbnail(new Point(40, 40));
morphToShow = new Morph(); morphToShow = new Morph();
morphToShow.silentSetWidth(img.width); morphToShow.isCachingImage = true;
morphToShow.silentSetHeight(img.height); morphToShow.bounds.setWidth(img.width);
morphToShow.image = img; morphToShow.bounds.setHeight(img.height);
morphToShow.cachedImage = img;
morphToShow.version = value.version; morphToShow.version = value.version;
morphToShow.step = function () { morphToShow.step = function () {
if (this.version !== value.version) { if (this.version !== value.version) {
img = value.thumbnail(new Point(40, 40)); img = value.thumbnail(new Point(40, 40));
this.image = img; this.cachedImage = img;
this.version = value.version; this.version = value.version;
this.changed(); this.changed();
} }
@ -2153,24 +2154,28 @@ SyntaxElementMorph.prototype.showBubble = function (value, exportPic, target) {
} else { } else {
img = value.fullImage(); img = value.fullImage();
morphToShow = new Morph(); morphToShow = new Morph();
morphToShow.silentSetWidth(img.width); morphToShow.isCachingImage = true;
morphToShow.silentSetHeight(img.height); morphToShow.bounds.setWidth(img.width);
morphToShow.image = img; morphToShow.bounds.setHeight(img.height);
morphToShow.cachedImage = img;
} }
} else if (value instanceof Costume) { } else if (value instanceof Costume) {
img = value.thumbnail(new Point(40, 40)); img = value.thumbnail(new Point(40, 40));
morphToShow = new Morph(); morphToShow = new Morph();
morphToShow.silentSetWidth(img.width); morphToShow = new Morph();
morphToShow.silentSetHeight(img.height); morphToShow.isCachingImage = true;
morphToShow.image = img; morphToShow.bounds.setWidth(img.width);
morphToShow.bounds.setHeight(img.height);
morphToShow.cachedImage = img;
} else if (value instanceof Sound) { } else if (value instanceof Sound) {
morphToShow = new SymbolMorph('notes', 30); morphToShow = new SymbolMorph('notes', 30);
} else if (value instanceof Context) { } else if (value instanceof Context) {
img = value.image(); img = value.image();
morphToShow = new Morph(); morphToShow = new Morph();
morphToShow.silentSetWidth(img.width); morphToShow.isCachingImage = true;
morphToShow.silentSetHeight(img.height); morphToShow.bounds.setWidth(img.width);
morphToShow.image = img; morphToShow.bounds.setHeight(img.height);
morphToShow.cachedImage = img;
} else if (typeof value === 'boolean') { } else if (typeof value === 'boolean') {
morphToShow = SpriteMorph.prototype.booleanMorph.call( morphToShow = SpriteMorph.prototype.booleanMorph.call(
null, null,

Wyświetl plik

@ -7068,7 +7068,7 @@ SpriteMorph.prototype.fullThumbnail = function (extentPoint) {
SpriteMorph.prototype.booleanMorph = function (bool) { SpriteMorph.prototype.booleanMorph = function (bool) {
var sym = new BooleanSlotMorph(bool); var sym = new BooleanSlotMorph(bool);
sym.isStatic = true; sym.isStatic = true;
sym.drawNew(); sym.fixLayout();
return sym; return sym;
}; };
@ -10906,26 +10906,31 @@ CellMorph.prototype.createContents = function () {
this.contents this.contents
).fullImage(); ).fullImage();
this.contentsMorph = new Morph(); this.contentsMorph = new Morph();
this.contentsMorph.silentSetWidth(img.width); this.contentsMorph.isCachingImage = true;
this.contentsMorph.silentSetHeight(img.height); this.contentsMorph.bounds.setWidth(img.width);
this.contentsMorph.image = img; this.contentsMorph.bounds.setHeight(img.height);
this.contentsMorph.cachedImage = img;
} else if (this.contents instanceof HTMLCanvasElement) { } else if (this.contents instanceof HTMLCanvasElement) {
img = this.contents;
this.contentsMorph = new Morph(); this.contentsMorph = new Morph();
this.contentsMorph.silentSetWidth(this.contents.width); this.contentsMorph.isCachingImage = true;
this.contentsMorph.silentSetHeight(this.contents.height); this.contentsMorph.bounds.setWidth(img.width);
this.contentsMorph.image = this.contents; this.contentsMorph.bounds.setHeight(img.height);
this.contentsMorph.cachedImage = img;
} else if (this.contents instanceof Context) { } else if (this.contents instanceof Context) {
img = this.contents.image(); img = this.contents.image();
this.contentsMorph = new Morph(); this.contentsMorph = new Morph();
this.contentsMorph.silentSetWidth(img.width); this.contentsMorph.isCachingImage = true;
this.contentsMorph.silentSetHeight(img.height); this.contentsMorph.bounds.setWidth(img.width);
this.contentsMorph.image = img; this.contentsMorph.bounds.setHeight(img.height);
this.contentsMorph.cachedImage = img;
} else if (this.contents instanceof Costume) { } else if (this.contents instanceof Costume) {
img = this.contents.thumbnail(new Point(40, 40)); img = this.contents.thumbnail(new Point(40, 40));
this.contentsMorph = new Morph(); this.contentsMorph = new Morph();
this.contentsMorph.silentSetWidth(img.width); this.contentsMorph.isCachingImage = true;
this.contentsMorph.silentSetHeight(img.height); this.contentsMorph.bounds.setWidth(img.width);
this.contentsMorph.image = img; this.contentsMorph.bounds.setHeight(img.height);
this.contentsMorph.cachedImage = img;
} else if (this.contents instanceof Sound) { } else if (this.contents instanceof Sound) {
this.contentsMorph = new SymbolMorph('notes', 30); this.contentsMorph = new SymbolMorph('notes', 30);
} else if (this.contents instanceof List) { } else if (this.contents instanceof List) {