diff --git a/packages/core/examples/canvas.html b/packages/core/examples/canvas.html index 685cc56ee..44ffd9f6d 100644 --- a/packages/core/examples/canvas.html +++ b/packages/core/examples/canvas.html @@ -2,8 +2,8 @@ @@ -25,6 +25,7 @@ function paint(code) { const pattern = eval(code); // run code const events = pattern.firstCycle(); // query first cycle + ctx.clearRect(0, 0, canvas.width, canvas.height); // clear canvas events.forEach((event) => { ctx.fillStyle = event.value; ctx.fillRect(event.whole.begin * canvas.width, 0, event.duration * canvas.width, canvas.height);