Announcement

Collapse
No announcement yet.

Canvas updates seem to pause shortly when scrolling

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Canvas updates seem to pause shortly when scrolling

    I have a demo project that draws sine waves on a canvas (https://deck.net/9a027d6d67e9bde632c5ab7845551b3a/left).
    When I scroll (even sometimes if there is nowhere to scroll, the canvas updates pause. (and if you try to continually scroll the mouse wheel--it results in continuous drawing stutter).

    Is this just part of the javascript canvas? Or could this be part of Timer implementation?
    Any ideas or thoughts would be appreciated.

    #2
    I can suggest to use requestAnimationFrame.
    https://deck.net/c2c5c74a8d8788c6a2626839c747dae8/left
    Last edited by geoffrey.mcgill; 2018-01-17 @ 08:15 PM.

    Comment


      #3
      How exactly is requestAnimationFrame made available? I see no special using. I assume that this is somehow tied directly to the Javascript -- but how?

      EDIT:
      Nevermind, it must be using static Retyped.dom;
      Last edited by selinc; 2018-01-17 @ 09:02 PM.

      Comment

      Working...
      X