caching canvas offsets to avoid reflows