From c455f416c2e0f54a2e67a09a360b2a450f26ad59 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 25 Mar 2020 12:20:04 +0100 Subject: [PATCH] fixed flickering issue with maps module --- src/maps.js | 7 +++++-- src/objects.js | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/maps.js b/src/maps.js index d0dc96da..90c460f6 100644 --- a/src/maps.js +++ b/src/maps.js @@ -38,7 +38,7 @@ // Global stuff //////////////////////////////////////////////////////// -modules.maps = '2020-March-19'; +modules.maps = '2020-March-25'; // WorldMap ///////////////////////////////////////////////////////////// @@ -287,7 +287,10 @@ WorldMap.prototype.render = function () { } } - this.canvas = newCanvas(this.extent, true, this.canvas); + // create a new canvas. Note, we cannot reuse the existing canvas, + // because it could be queried while tiles are still rendering + this.canvas = newCanvas(this.extent, true); + ctx = this.canvas.getContext('2d'); for (x = 0; x < tileGrid.x; x += 1) { for (y = 0; y < tileGrid.y; y += 1) { diff --git a/src/objects.js b/src/objects.js index 60a7fdfd..c377dafb 100644 --- a/src/objects.js +++ b/src/objects.js @@ -3484,6 +3484,7 @@ SpriteMorph.prototype.wearCostume = function (costume, noShadow) { y = this.yPosition ? this.yPosition() : null, idx = isNil(costume) ? null : this.costumes.asArray().indexOf(costume), isWarped = this.isWarped; + if (isWarped) { this.endWarp(); }