S
S
Sergey Savchenko2021-06-08 11:30:23
Canvas
Sergey Savchenko, 2021-06-08 11:30:23

How to remove overlay from a constantly drawn canvas?

There is a canvas that constantly draws moving lines, when setting a transparent background, which I want to achieve, so that the background gradient of the page is visible behind the canvas, the overlay of a new drawing on the old one begins to occur. Tell me, please, how to get rid of it?
Below is the codepen link
https://codepen.io/wvenator/pen/BaWVwqb

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Savchenko, 2021-06-08
@wvenator

I solved the problem by clearing the host with each new drawing, I wrote the following code at the beginning of the function:
$.clearRect(0, 0, canvas.width, canvas.height);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question