clear board before drawing

This commit is contained in:
histausse 2022-02-13 14:54:45 +01:00
parent 8333df9474
commit 75a27da34f
Signed by: histausse
GPG key ID: 67486F107F62E9E9

View file

@ -50,6 +50,7 @@ pub fn start() {
Some(date) if (Date::now() - date) < 250. => (), Some(date) if (Date::now() - date) < 250. => (),
_ => { _ => {
timestamp = Some(Date::now()); timestamp = Some(Date::now());
context.clear_rect(0., 0., canvas.width() as f64, canvas.height() as f64);
context.begin_path(); context.begin_path();
let iter = CircleShapes::new(modulo, factor, Circle {center: Point {x: 400.0, y: 400.0}, radius: 400.0}); let iter = CircleShapes::new(modulo, factor, Circle {center: Point {x: 400.0, y: 400.0}, radius: 400.0});
for shape in iter { for shape in iter {