From 75a27da34f3ac39e7ddd34e9e8989e28169b09b3 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Sun, 13 Feb 2022 14:54:45 +0100 Subject: [PATCH] clear board before drawing --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index f909f25..37dbe37 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,7 @@ pub fn start() { Some(date) if (Date::now() - date) < 250. => (), _ => { timestamp = Some(Date::now()); + context.clear_rect(0., 0., canvas.width() as f64, canvas.height() as f64); context.begin_path(); let iter = CircleShapes::new(modulo, factor, Circle {center: Point {x: 400.0, y: 400.0}, radius: 400.0}); for shape in iter {