0
\$\begingroup\$

What would be a good way to scroll the content of a huge html5 canvas so that the scroll is crisp and smooth, and memory consumption (and cpu load or battery consumption) is also reasonable?

any good library that can take care of it for you? Any specific plotting algorithm that will avoid a jumpy feel?

I guess the best way is to pre-plot upwards and downwards of the current viewport, but if the user quickly scrolls a whole lot up, I assume that some algorithms outperform others.

My canvas has very little repetition drawn on it, in case it matters, and the content doesn't change much. Just a very very long canvas element that also contains a lot of text, and needs to smoothly scroll in the browser viewport.

\$\endgroup\$
  • \$\begingroup\$ It is a bit unclear what you are asking. Are you trying to move the canvas element? Or are you trying to scroll the content of the canvas. Please try to revise this question and provide more details :) \$\endgroup\$ – Lysol Jan 30 '14 at 4:19
  • \$\begingroup\$ Scroll the content of the canvas (does scroll mean something else as well?). Sorry if it was ambiguous. \$\endgroup\$ – matt Jan 30 '14 at 16:10
  • \$\begingroup\$ Is there anything that you have tried so far? \$\endgroup\$ – Lysol Jan 30 '14 at 16:58
  • \$\begingroup\$ Sorry, it's not a fix-my-code question. \$\endgroup\$ – matt Jan 30 '14 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.