From 996574437ac78a740dfc1d92a2a53dada4942f91 Mon Sep 17 00:00:00 2001 From: Jens Getreu Date: Mon, 22 Jun 2020 09:32:41 +0200 Subject: [PATCH] Fix game of life (#1339) * follow changes in rand crate `wasm-bindgen` feature is not forwarded any more. See: https://github.com/rust-random/rand/commit/0aa461715b2a677cb6c62248e889c06d2534b441 * update index.html to new template See: https://yew.rs/docs/getting-started/build-a-sample-app * correct dimensions of playground tested with Firefox 77.0.1 * Update examples/game_of_life/src/lib.rs Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com> Co-authored-by: Jens Getreu Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com> --- examples/game_of_life/Cargo.toml | 8 +++++--- examples/game_of_life/src/lib.rs | 4 ++-- examples/game_of_life/static/index.html | 11 ++++++----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/examples/game_of_life/Cargo.toml b/examples/game_of_life/Cargo.toml index 4addaec6468..41f8e5350fe 100644 --- a/examples/game_of_life/Cargo.toml +++ b/examples/game_of_life/Cargo.toml @@ -1,13 +1,15 @@ [package] name = "game_of_life" -version = "0.1.3" +version = "0.1.4" authors = ["Diego Cardoso ", "Ilya Bogdanov "] edition = "2018" [dependencies] -rand = "0.7.3" -log = "0.4" +log = "0.4.8" wasm-logger = "0.2.0" yew = { path = "../../yew" } +rand = { version = "0.7.3", features = ["getrandom"] } +getrandom = { version = "0.1.14", features = ["wasm-bindgen"] } + diff --git a/examples/game_of_life/src/lib.rs b/examples/game_of_life/src/lib.rs index 4427588cfa4..7d6f7ee652c 100644 --- a/examples/game_of_life/src/lib.rs +++ b/examples/game_of_life/src/lib.rs @@ -165,9 +165,9 @@ impl Component for Model { Cellule { life_state: LifeState::Dead }; - 2000 + 53 * 40 ], - cellules_width: 50, + cellules_width: 53, cellules_height: 40, job: Box::new(handle), } diff --git a/examples/game_of_life/static/index.html b/examples/game_of_life/static/index.html index 741ea16d3ba..fcc760b88fb 100644 --- a/examples/game_of_life/static/index.html +++ b/examples/game_of_life/static/index.html @@ -3,10 +3,11 @@ Yew • Game of Life - - + + - - - +