Do browsers render canvas elements that are not inside the viewport?

前端 未结 2 2030
独厮守ぢ
独厮守ぢ 2021-02-09 05:15

I have a page that has pretty heavy (mid-weight rather) canvas operations going on. To cater for users on mobile devices and older computers I was thinking I could

2条回答
  •  太阳男子
    2021-02-09 05:20

    From my own experience it renders whatever you tell it to render regardless of position on screen.

    An example is if you draw tiles, that exceeds the canvas size, you will still see the performance drop unless you optimize the script.

    Try your function with a performance demanding animation, and see if you still get the same results.

提交回复
热议问题