kopia lustrzana https://github.com/backface/turtlestitch
recycle thumbnail canvasses in sprite icons
rodzic
066eb201a1
commit
e6bce597a4
16
src/gui.js
16
src/gui.js
|
@ -6877,7 +6877,7 @@ ProjectDialogMorph.prototype.installCloudProjectList = function (pl) {
|
||||||
myself.notesText.rerender();
|
myself.notesText.rerender();
|
||||||
myself.notesField.contents.adjustBounds();
|
myself.notesField.contents.adjustBounds();
|
||||||
myself.preview.texture = '';
|
myself.preview.texture = '';
|
||||||
myself.preview.rerender(); // +++
|
myself.preview.rerender();
|
||||||
// we ask for the thumbnail when selecting a project
|
// we ask for the thumbnail when selecting a project
|
||||||
myself.ide.cloud.getThumbnail(
|
myself.ide.cloud.getThumbnail(
|
||||||
null, // username is implicit
|
null, // username is implicit
|
||||||
|
@ -8019,14 +8019,22 @@ SpriteIconMorph.prototype.createThumbnail = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.thumbnail = new Morph();
|
this.thumbnail = new Morph();
|
||||||
this.thumbnail.isCachingImage = true; // +++ review thumbnails
|
this.thumbnail.isCachingImage = true;
|
||||||
this.thumbnail.bounds.setExtent(this.thumbSize);
|
this.thumbnail.bounds.setExtent(this.thumbSize);
|
||||||
if (this.object instanceof SpriteMorph) { // support nested sprites
|
if (this.object instanceof SpriteMorph) { // support nested sprites
|
||||||
this.thumbnail.cachedImage = this.object.fullThumbnail(this.thumbSize); // +++ recycle canvas
|
this.thumbnail.cachedImage = this.object.fullThumbnail(
|
||||||
|
this.thumbSize,
|
||||||
|
false,
|
||||||
|
this.thumbnail.cachedImage
|
||||||
|
);
|
||||||
this.add(this.thumbnail);
|
this.add(this.thumbnail);
|
||||||
this.createRotationButton();
|
this.createRotationButton();
|
||||||
} else {
|
} else {
|
||||||
this.thumbnail.cachedImage = this.object.thumbnail(this.thumbSize);
|
this.thumbnail.cachedImage = this.object.thumbnail(
|
||||||
|
this.thumbSize,
|
||||||
|
false,
|
||||||
|
this.thumbnail.cachedImage
|
||||||
|
);
|
||||||
this.add(this.thumbnail);
|
this.add(this.thumbnail);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue