X-Git-Url: https://git.yukkurigames.com/?p=yuu.git;a=blobdiff_plain;f=src%2Fyuu%2Fdirector.js;h=42d891b25deceeb9b6643d8eb57b999e6924bab4;hp=e1c0b538b24230cd19e8a00a301d1e64d4ad0dad;hb=891552a25000e991e5a4ff3cf7082ae0a3e43436;hpb=54c0c4081df55f293bfb5e3a0871aade286608ab diff --git a/src/yuu/director.js b/src/yuu/director.js index e1c0b53..42d891b 100644 --- a/src/yuu/director.js +++ b/src/yuu/director.js @@ -304,12 +304,8 @@ this._resized = true; var director = this; this._rafId = window.requestAnimationFrame(function _ (t) { - if (!director._timerStart) { + if (!director._timerStart) director._timerStart = t; - director._audioOffset = yuu.audio - ? yuu.audio.currentTime * 1000 - t - : 0; - } director._rafId = window.requestAnimationFrame(_); director.render(t); }); @@ -385,6 +381,10 @@ /** Tick and render all scenes, bottom to top */ var i; + this._audioOffset = yuu.audio + ? yuu.audio.currentTime * 1000 - t + : 0; + if (this._resized) { this._dispatchSceneInput("resize", [yuu.canvas]); this._resized = false;