From 6fd93533ecb01c27589bfe569d8e22013a77f65c Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 31 Mar 2014 13:09:31 +0200 Subject: display costume thumbnails in speech/thought/value bubbles and watcher cells --- objects.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 37daa69..a6d2c9a 100644 --- a/objects.js +++ b/objects.js @@ -5058,6 +5058,12 @@ SpriteBubbleMorph.prototype.dataAsMorph = function (data) { contents.silentSetWidth(img.width); contents.silentSetHeight(img.height); contents.image = img; + } else if (data instanceof Costume) { + img = data.thumbnail(new Point(40, 40)); + contents = new Morph(); + contents.silentSetWidth(img.width); + contents.silentSetHeight(img.height); + contents.image = img; } else if (data instanceof HTMLCanvasElement) { contents = new Morph(); contents.silentSetWidth(data.width); @@ -5900,6 +5906,12 @@ CellMorph.prototype.drawNew = function () { this.contentsMorph.silentSetWidth(img.width); this.contentsMorph.silentSetHeight(img.height); this.contentsMorph.image = img; + } else if (this.contents instanceof Costume) { + img = this.contents.thumbnail(new Point(40, 40)); + this.contentsMorph = new Morph(); + this.contentsMorph.silentSetWidth(img.width); + this.contentsMorph.silentSetHeight(img.height); + this.contentsMorph.image = img; } else if (this.contents instanceof List) { if (this.isCircular()) { this.contentsMorph = new TextMorph( -- cgit v1.3.1