OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
91 stars 20 forks source link

Smooth flights #925

Open jaredkhan opened 2 days ago

jaredkhan commented 2 days ago

Fixes #910

Before: https://github.com/user-attachments/assets/7e1d2d55-ac31-44c6-82b4-b9c2c312f9c6

After: https://github.com/user-attachments/assets/63a520af-c209-4502-8d74-d105ffe137c2

Essentially replacing the use of setTimeout with the use of requestAnimationFrame in a way that checks the elapsed time and does the movement propoertionally based on that

davidebbo commented 2 days ago

Tests failing with:

ReferenceError: localStorage is not defined
    at progressWipe (/home/david/www-dev/web2py/applications/OZtree/OZprivate/rawJS/OZTreeModule/src/tour/handler/TsProgress.js:97:17)

Maybe something needs to be mocked?

jaredkhan commented 2 days ago

Yeah the localStorage thing is there in main too actually, the actual failure was due to requestAnimationFrame not being available. Fixed now.

davidebbo commented 2 days ago

Thanks, it passes now for me. But FWIW, it's not failing for me on main.

jaredkhan commented 2 days ago

No I'm not saying it fails on main , just that the error you quoted is there when running the tests: (ReferenceError: localStorage is not defined...)

davidebbo commented 2 days ago

No I'm not saying it fails on main , just that the error you quoted is there when running the tests: (ReferenceError: localStorage is not defined...)

Ah I see!

davidebbo commented 1 day ago

Tried it, definitely looks smoother!