kopia lustrzana https://github.com/backface/turtlestitch
display costume thumbnails in speech/thought/value bubbles and watcher cells
rodzic
ca9445c245
commit
6fd93533ec
|
@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph, Costume*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.blocks = '2014-February-11';
|
||||
modules.blocks = '2014-March-31';
|
||||
|
||||
|
||||
var SyntaxElementMorph;
|
||||
|
@ -1635,6 +1635,12 @@ SyntaxElementMorph.prototype.showBubble = function (value) {
|
|||
morphToShow.silentSetWidth(img.width);
|
||||
morphToShow.silentSetHeight(img.height);
|
||||
morphToShow.image = img;
|
||||
} else if (value instanceof Costume) {
|
||||
img = value.thumbnail(new Point(40, 40));
|
||||
morphToShow = new Morph();
|
||||
morphToShow.silentSetWidth(img.width);
|
||||
morphToShow.silentSetHeight(img.height);
|
||||
morphToShow.image = img;
|
||||
} else if (value instanceof Context) {
|
||||
img = value.image();
|
||||
morphToShow = new Morph();
|
||||
|
|
|
@ -2107,3 +2107,4 @@ ______
|
|||
140331
|
||||
------
|
||||
* Objects: experimental “wardrobe” and “jukebox” reporters in dev mode
|
||||
* Blocks, Objects: display costume thumbnails in speech/thought/value bubbles and watcher cells
|
||||
|
|
12
objects.js
12
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(
|
||||
|
|
Ładowanie…
Reference in New Issue