1
0
Fork 0
mirror of https://github.com/sexybiggetje/pixdisp.git synced 2024-11-21 21:51:02 +01:00

Fix binding for getDelta()

This commit is contained in:
Martijn de Boer 2018-06-27 19:33:13 +02:00
parent c2515869e3
commit 13961a2f8e

View file

@ -54,27 +54,27 @@ class VMController
'drawCircle': this.driver.drawCircle.bind( this.driver ),
'write': this.driver.write.bind( this.driver ),
'delta': this.getDelta.bind( this ),
'getDelta': this.getDelta.bind( this ),
'run': this.run.bind( this )
};
}
runScript( ) {
let delta = 0;
let deltaLocal = 0;
let tmd = this.getTimeData();
delta = tmd - this.previousTime;
deltaLocal = tmd - this.previousTime;
this.previousTime = tmd;
this.delta = delta / 1000000;
this.delta = deltaLocal / 1000000;
this.vm.run( this.runningVmScript, 'pixdisp-sandbox.js' );
if ( this.runNextFrame === true ) {
this.runNextFrame = false;
setTimeout( this.runScript.bind( this ), 1 );
setTimeout( this.runScript.bind( this ), 1000 / 60 );
}
}