Reverting screen optimization to use SetInterval and didChange

This commit is contained in:
Sam El-Husseini
2017-12-19 12:53:12 -08:00
parent e07d6e3a31
commit 785ddff706
2 changed files with 15 additions and 4 deletions

View File

@ -136,6 +136,10 @@ namespace pxsim.visuals {
this.board.updateSubscribers.push(() => this.updateState());
this.updateState();
}
let that = this;
window.setInterval(function(){
that.updateScreen();
}, 30);
}
public getView(): SVGAndSize<SVGSVGElement> {
@ -169,7 +173,6 @@ namespace pxsim.visuals {
public updateState() {
this.updateVisibleNodes();
this.updateScreen();
}
private updateVisibleNodes() {
@ -396,6 +399,7 @@ namespace pxsim.visuals {
private updateScreen() {
let state = ev3board().screenState;
if (!state.didChange()) return;
const bBox = this.layoutView.getBrick().getScreenBBox();
if (!bBox || bBox.width == 0) return;