diff --git a/lib/app_component.dart b/lib/app_component.dart index afce95f..c23443e 100644 --- a/lib/app_component.dart +++ b/lib/app_component.dart @@ -48,5 +48,8 @@ class AppComponent implements OnInit { engine.reset(); } - void onRandomClicked() {} + void onRandomClicked() { + engine.running = false; + engine.grid.addPattern(); + } } diff --git a/lib/src/Grid.dart b/lib/src/Grid.dart index 5730461..062a78c 100644 --- a/lib/src/Grid.dart +++ b/lib/src/Grid.dart @@ -83,6 +83,7 @@ class Grid { } break; } + _dirty = true; } void setCellState(int x, int y, bool state) {