Closed Radagaisus closed 11 years ago
see https://github.com/ded/morpheus/pull/36/files for full gory details. are you using the latest version?
I am not on the latest version.
Does this line start = perf && perf.now ? perf.now() : +new Date()
fixes the problem?
Sort of, it's a bit more involved than that. Upgrade to the latest version and try it out. Chrome is now using its own high perf timer as a reference for rAF
so Morpheus needs to detect whether the browser is using epoch-based times or perf.now()
-based times.
Keep in mind that this probably isn't the end of the story; other browsers are likely to shift on rAF
, Mozilla was proposing something different still a while back so it's still a little in flux.
I should have pointed you to the discussion in https://github.com/ded/morpheus/pull/36 rather than the actual diff cause that wasn't the final merged version but it has most of the discussion around the issue. #38 was the final version, see that diff for the code details.
Thanks! It's hard living on the cutting edge ;)
Hi,
I don't know why, and I don't see any mention of it, but Chrome changed the argument passed to requestAnimationFrame's callback function, and it's not the current epoch time any more.
Morpheus live examples don't seem to break, but pretty much every animation I have on my project is now broken. The
complete
callback functions are never called.Commenting out
win.webkitRequestAnimationFrame
andwin.requestAnimationFrame
fixes the problem for now. Returning a function that wraps around the requestAnimationFrame insideframe()
is probably a decent fix. I can write a pull request but it's 6am, so I'm not going to do this right now.