diff --git a/lib/app_component.dart b/lib/app_component.dart index 4169c55..9f97ef0 100644 --- a/lib/app_component.dart +++ b/lib/app_component.dart @@ -54,7 +54,7 @@ class AppComponent implements OnInit { } void onEdgesClicked() { - engine.grid.switchEdgeRendering(); + engine.toggleEdgeRendering(); } void onClearClicked() { diff --git a/lib/src/Engine.dart b/lib/src/Engine.dart index a4043b7..cc59f96 100644 --- a/lib/src/Engine.dart +++ b/lib/src/Engine.dart @@ -65,6 +65,8 @@ class Engine { void render([num interp]) { // print("rendering"); grid.render(canvas, interp); + void toggleEdgeRendering() { + _grid.renderEdges = !_grid.renderEdges; } void set running(bool on) => _running = on; diff --git a/lib/src/Grid.dart b/lib/src/Grid.dart index f47e5bf..7c4bcad 100644 --- a/lib/src/Grid.dart +++ b/lib/src/Grid.dart @@ -210,6 +210,9 @@ class Grid { void switchEdgeRendering([bool on]) { _renderEdges = on ?? !_renderEdges; + void set renderEdges(bool on) { + _renderEdges = on; _dirty = true; } + bool get renderEdges => _renderEdges; }