diff --git a/HISTORY.md b/HISTORY.md index 08b88199..30ff4e96 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -71,6 +71,9 @@ * Brazilian Portuguese, thank you, Cassiano D'Andrea! * Catalan, thanks, Joan! +### 2021-12-13 +* objects: tweaked asynchronous costume loading/rendering issue + ### 2021-12-12 * threads: fixed #2932 diff --git a/snap.html b/snap.html index 7ecdf5b1..f1232443 100755 --- a/snap.html +++ b/snap.html @@ -18,7 +18,7 @@ - + diff --git a/src/objects.js b/src/objects.js index 9889a168..eeebbbe0 100644 --- a/src/objects.js +++ b/src/objects.js @@ -87,7 +87,7 @@ BlockVisibilityDialogMorph*/ /*jshint esversion: 6*/ -modules.objects = '2021-December-11'; +modules.objects = '2021-December-13'; var SpriteMorph; var StageMorph; @@ -8076,10 +8076,7 @@ StageMorph.prototype.render = function (ctx) { ctx.save(); ctx.fillStyle = this.color.toString(); ctx.fillRect(0, 0, this.width(), this.height()); - if (this.costume && - this.costume.contents.width && - this.costume.contents.height - ) { + if (this.costume && !(this.costume.loaded instanceof Function)) { ctx.scale(this.scale, this.scale); ctx.drawImage( this.costume.contents, @@ -8087,9 +8084,6 @@ StageMorph.prototype.render = function (ctx) { (this.height() / this.scale - this.costume.height()) / 2 ); this.cachedImage = this.applyGraphicsEffects(this.cachedImage); - } else { // deal with async asset creation - this.costume = null; - this.cachedImage = null; } ctx.restore(); this.version = Date.now(); // for observer optimization