Remove Local isRunning Variable in Component
This commit is contained in:
parent
69b680e554
commit
020bb6b918
1 changed files with 2 additions and 7 deletions
|
@ -12,7 +12,6 @@ class AppComponent implements OnInit {
|
||||||
var name = "World";
|
var name = "World";
|
||||||
|
|
||||||
App engine;
|
App engine;
|
||||||
String buttonRunText = "Start";
|
|
||||||
|
|
||||||
@ViewChild("caCanvas")
|
@ViewChild("caCanvas")
|
||||||
html.CanvasElement canvas;
|
html.CanvasElement canvas;
|
||||||
|
@ -22,6 +21,7 @@ class AppComponent implements OnInit {
|
||||||
canvas.context2D.setFillColorRgb(255, 0, 0);
|
canvas.context2D.setFillColorRgb(255, 0, 0);
|
||||||
canvas.context2D.fillRect(0, 0, 200, 150);
|
canvas.context2D.fillRect(0, 0, 200, 150);
|
||||||
engine = new App(canvas);
|
engine = new App(canvas);
|
||||||
|
|
||||||
html.window.animationFrame.then(animFrame);
|
html.window.animationFrame.then(animFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,14 +31,9 @@ class AppComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
void onStartClicked() {
|
void onStartClicked() {
|
||||||
bool isRunning = !engine.running;
|
engine.running = !engine.running;
|
||||||
engine.running = isRunning;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (isRunning) {
|
|
||||||
case true: buttonRunText = "Stop"; break;
|
|
||||||
case false: buttonRunText = "Start"; break;
|
|
||||||
}
|
|
||||||
void onStepClicked() {
|
void onStepClicked() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue