Remove throttle, and add a little random initialisation so you don't get the synchronized flickering

pull/3/head
Jelmer van der Linde 2017-08-31 18:06:12 +02:00
rodzic 14e1243ae0
commit 88c530ff1f
1 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -122,6 +122,7 @@
class Sequence {
constructor(seq) {
this.offset = Math.random();
this.setSequence(seq);
}
@ -148,7 +149,7 @@
if (isNaN(this.duration))
return undefined;
let dt = time % this.duration;
let dt = this.offset + time % this.duration;
for (let i = 0; i < this.steps.length; ++i) {
if (dt < this.steps[i][1])
@ -205,9 +206,7 @@
let update = function(t) {
draw(t / 1000);
setTimeout(function() {
requestAnimationFrame(update);
}, 50);
requestAnimationFrame(update);
};
update(0);