fix: stage ticking

This commit is contained in:
cha0s 2021-03-31 11:44:20 -05:00
parent e81950e084
commit f63e607396

View File

@ -62,8 +62,13 @@ const Stage = ({
return undefined;
}
let handle;
const tick = (elapsed) => {
ticker(elapsed);
let last;
const tick = (now) => {
if (undefined === last) {
last = now;
}
ticker((now - last) / 1000);
last = now;
renderer.render(renderable);
handle = requestAnimationFrame(tick);
};