Transparent string on HTML5 canvas

Is there a way to untie the line? Let's say on my canvas I have a line with a transparency of 0.5 and a width of 20 pixels. Now I want to do it longer, then make another line straight from the old. in this case, the coincidence points between the old and new lines become less transparent (because now they consist of two lines). so I want to untie the old string and then stroke the new one.

How can i do this?

thank

+5
source share
4 answers

, API, / , . , , . (, atm)

- . lineTo , , , , ( , ), ( , , ).

, , CPU/GPU,

+5

clearRect() - . ( , ) , HTML, , "" , /. , .

+11

- "globalCompositeOperation" "xor" ...,

+7

, ( clearRect)

+5

All Articles