Remove Local isRunning Variable in Component

This commit is contained in:
Marty Oehme 2018-07-07 19:07:07 +02:00
parent 69b680e554
commit 020bb6b918

View file

@ -12,7 +12,6 @@ class AppComponent implements OnInit {
var name = "World";
App engine;
String buttonRunText = "Start";
@ViewChild("caCanvas")
html.CanvasElement canvas;
@ -22,6 +21,7 @@ class AppComponent implements OnInit {
canvas.context2D.setFillColorRgb(255, 0, 0);
canvas.context2D.fillRect(0, 0, 200, 150);
engine = new App(canvas);
html.window.animationFrame.then(animFrame);
}
@ -31,14 +31,9 @@ class AppComponent implements OnInit {
}
void onStartClicked() {
bool isRunning = !engine.running;
engine.running = isRunning;
engine.running = !engine.running;
}
switch (isRunning) {
case true: buttonRunText = "Stop"; break;
case false: buttonRunText = "Start"; break;
}
void onStepClicked() {
}