enthought / tabs

Default Repo description from terraform module
0 stars 0 forks source link

Don't waste CPU when not visible #65

Closed kjordahl closed 8 years ago

kjordahl commented 8 years ago

Uses L.Util.requestAnimFrame so that redraws will only happen while the browser window is active. This has the effect of pausing animation when the browser is hidden (or switched to another tab, etc.).

Reference: http://www.paulirish.com/2011/requestanimationframe-for-smart-animating

kjordahl commented 8 years ago

Works for me in Firefox and Chrome in OS X.

kjordahl commented 8 years ago

This is much less of a big deal with #66 improving performance, and WebGL seems to be smarter about using CPU when not visible anyway, but this still works and seems to do no harm.

johntyree commented 8 years ago

I think the carto db layer was already doing this as well.