Open
Description
Issue or Feature
The code below can be triggered repeatedly. E.g. by click a button. Everything a dynamically generated image is returned by the backend. I already clear the context before drawing the image. But the image is still repeated drawing over the previous images. The only thing I can think about is the loadImage is returning image that draws over previous image.
Steps to Reproduce
var {loadImage, createCanvas} = require('canvas');
const image = await loadImage(`/newimage?${Math.random()}`);
const canvas = createCanvas(200, 200);
const context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillStyle = "rgba(0, 0, 0, 1)";
context.fillRect(0, 0, canvas.width, canvas.height);
context.drawImage(terrain, 0, 0, canvas.width, canvas.height);
Your Environment
Version: "2.6.1"
Environment: Chrome browser